You can subscribe to this list here.
2010 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
(28) |
Jun
(12) |
Jul
(11) |
Aug
(12) |
Sep
(5) |
Oct
(19) |
Nov
(14) |
Dec
(12) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2011 |
Jan
(18) |
Feb
(30) |
Mar
(115) |
Apr
(89) |
May
(50) |
Jun
(44) |
Jul
(22) |
Aug
(13) |
Sep
(11) |
Oct
(30) |
Nov
(28) |
Dec
(39) |
2012 |
Jan
(38) |
Feb
(18) |
Mar
(43) |
Apr
(91) |
May
(108) |
Jun
(46) |
Jul
(37) |
Aug
(44) |
Sep
(33) |
Oct
(29) |
Nov
(36) |
Dec
(15) |
2013 |
Jan
(35) |
Feb
(611) |
Mar
(5) |
Apr
(55) |
May
(30) |
Jun
(28) |
Jul
(458) |
Aug
(34) |
Sep
(9) |
Oct
(39) |
Nov
(22) |
Dec
(32) |
2014 |
Jan
(16) |
Feb
(16) |
Mar
(42) |
Apr
(179) |
May
(7) |
Jun
(6) |
Jul
(9) |
Aug
|
Sep
(4) |
Oct
|
Nov
(3) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
1
(3) |
2
(5) |
3
|
4
(4) |
5
|
6
|
7
(7) |
8
(10) |
9
(6) |
10
(5) |
11
(1) |
12
|
13
|
14
|
15
|
16
|
17
(4) |
18
(1) |
19
|
20
|
21
(5) |
22
(15) |
23
(18) |
24
(7) |
25
(4) |
26
|
27
|
28
(3) |
29
(2) |
30
(11) |
31
(4) |
|
|
From: Abbas B. <ga...@us...> - 2011-03-09 16:49:31
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via baed9de74d766b401d088918e809dc9e51b313f7 (commit) from 565200f09a592715c10cbbec578c6b74a25e2bc2 (commit) - Log ----------------------------------------------------------------- commit baed9de74d766b401d088918e809dc9e51b313f7 Author: Abbas <abb...@en...> Date: Wed Mar 9 21:50:22 2011 +0500 Block FK Constraints and add some missing checks diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c index 5b6ba6b..1777199 100644 --- a/src/backend/parser/parse_utilcmd.c +++ b/src/backend/parser/parse_utilcmd.c @@ -1552,7 +1552,9 @@ transformIndexConstraint(Constraint *constraint, CreateStmtContext *cxt) } #ifdef PGXC if (IS_PGXC_COORDINATOR && cxt->distributeby - && cxt->distributeby->disttype == DISTTYPE_HASH && !isLocalSafe) + && ( cxt->distributeby->disttype == DISTTYPE_HASH || + cxt->distributeby->disttype == DISTTYPE_MODULO) + && !isLocalSafe) ereport(ERROR, (errcode(ERRCODE_INVALID_COLUMN_REFERENCE), errmsg("Unique index of partitioned table must contain the hash distribution column."))); @@ -2136,7 +2138,15 @@ transformAlterTableStmt(AlterTableStmt *stmt, const char *queryString) transformTableConstraint(pstate, &cxt, (Constraint *) cmd->def); if (((Constraint *) cmd->def)->contype == CONSTR_FOREIGN) + { skipValidation = false; +#ifdef PGXC + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("Postgres-XC does not support FOREIGN constraints yet"), + errdetail("The feature is not currently supported"))); +#endif + } } else elog(ERROR, "unrecognized node type: %d", @@ -2583,7 +2593,8 @@ static checkLocalFKConstraints(CreateStmtContext *cxt) { if (cxt->distributeby) { - if (cxt->distributeby->disttype == DISTTYPE_HASH) + if (cxt->distributeby->disttype == DISTTYPE_HASH || + cxt->distributeby->disttype == DISTTYPE_MODULO) checkcolname = cxt->distributeby->colname; } else ----------------------------------------------------------------------- Summary of changes: src/backend/parser/parse_utilcmd.c | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-03-09 07:33:18
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via 565200f09a592715c10cbbec578c6b74a25e2bc2 (commit) from d6beeda6a68cce6f74d179e3520443be2a29bb4d (commit) - Log ----------------------------------------------------------------- commit 565200f09a592715c10cbbec578c6b74a25e2bc2 Author: Michael P <mic...@us...> Date: Wed Mar 9 16:31:37 2011 +0900 Fix for regression test inet An ORDER BY is necessary to reorder output of a SELECT query. Output has also been updated. diff --git a/src/test/regress/expected/inet_1.out b/src/test/regress/expected/inet_1.out new file mode 100644 index 0000000..881770b --- /dev/null +++ b/src/test/regress/expected/inet_1.out @@ -0,0 +1,455 @@ +-- +-- INET +-- +-- prepare the table... +DROP TABLE INET_TBL; +ERROR: table "inet_tbl" does not exist +CREATE TABLE INET_TBL (c cidr, i inet); +INSERT INTO INET_TBL (c, i) VALUES ('192.168.1', '192.168.1.226/24'); +INSERT INTO INET_TBL (c, i) VALUES ('192.168.1.0/26', '192.168.1.226'); +INSERT INTO INET_TBL (c, i) VALUES ('192.168.1', '192.168.1.0/24'); +INSERT INTO INET_TBL (c, i) VALUES ('192.168.1', '192.168.1.0/25'); +INSERT INTO INET_TBL (c, i) VALUES ('192.168.1', '192.168.1.255/24'); +INSERT INTO INET_TBL (c, i) VALUES ('192.168.1', '192.168.1.255/25'); +INSERT INTO INET_TBL (c, i) VALUES ('10', '10.1.2.3/8'); +INSERT INTO INET_TBL (c, i) VALUES ('10.0.0.0', '10.1.2.3/8'); +INSERT INTO INET_TBL (c, i) VALUES ('10.1.2.3', '10.1.2.3/32'); +INSERT INTO INET_TBL (c, i) VALUES ('10.1.2', '10.1.2.3/24'); +INSERT INTO INET_TBL (c, i) VALUES ('10.1', '10.1.2.3/16'); +INSERT INTO INET_TBL (c, i) VALUES ('10', '10.1.2.3/8'); +INSERT INTO INET_TBL (c, i) VALUES ('10', '11.1.2.3/8'); +INSERT INTO INET_TBL (c, i) VALUES ('10', '9.1.2.3/8'); +INSERT INTO INET_TBL (c, i) VALUES ('10:23::f1', '10:23::f1/64'); +INSERT INTO INET_TBL (c, i) VALUES ('10:23::8000/113', '10:23::ffff'); +INSERT INTO INET_TBL (c, i) VALUES ('::ffff:1.2.3.4', '::4.3.2.1/24'); +-- check that CIDR rejects invalid input: +INSERT INTO INET_TBL (c, i) VALUES ('192.168.1.2/30', '192.168.1.226'); +ERROR: invalid cidr value: "192.168.1.2/30" +LINE 1: INSERT INTO INET_TBL (c, i) VALUES ('192.168.1.2/30', '192.1... + ^ +DETAIL: Value has bits set to right of mask. +INSERT INTO INET_TBL (c, i) VALUES ('1234::1234::1234', '::1.2.3.4'); +ERROR: invalid input syntax for type cidr: "1234::1234::1234" +LINE 1: INSERT INTO INET_TBL (c, i) VALUES ('1234::1234::1234', '::1... + ^ +-- check that CIDR rejects invalid input when converting from text: +INSERT INTO INET_TBL (c, i) VALUES (cidr('192.168.1.2/30'), '192.168.1.226'); +ERROR: invalid cidr value: "192.168.1.2/30" +LINE 1: INSERT INTO INET_TBL (c, i) VALUES (cidr('192.168.1.2/30'), ... + ^ +DETAIL: Value has bits set to right of mask. +INSERT INTO INET_TBL (c, i) VALUES (cidr('ffff:ffff:ffff:ffff::/24'), '::192.168.1.226'); +ERROR: invalid cidr value: "ffff:ffff:ffff:ffff::/24" +LINE 1: INSERT INTO INET_TBL (c, i) VALUES (cidr('ffff:ffff:ffff:fff... + ^ +DETAIL: Value has bits set to right of mask. +SELECT '' AS ten, c AS cidr, i AS inet FROM INET_TBL ORDER BY cidr; + ten | cidr | inet +-----+--------------------+------------------ + | 10.0.0.0/8 | 9.1.2.3/8 + | 10.0.0.0/8 | 11.1.2.3/8 + | 10.0.0.0/8 | 10.1.2.3/8 + | 10.0.0.0/8 | 10.1.2.3/8 + | 10.0.0.0/32 | 10.1.2.3/8 + | 10.1.0.0/16 | 10.1.2.3/16 + | 10.1.2.0/24 | 10.1.2.3/24 + | 10.1.2.3/32 | 10.1.2.3 + | 192.168.1.0/24 | 192.168.1.0/25 + | 192.168.1.0/24 | 192.168.1.226/24 + | 192.168.1.0/24 | 192.168.1.255/25 + | 192.168.1.0/24 | 192.168.1.0/24 + | 192.168.1.0/24 | 192.168.1.255/24 + | 192.168.1.0/26 | 192.168.1.226 + | ::ffff:1.2.3.4/128 | ::4.3.2.1/24 + | 10:23::f1/128 | 10:23::f1/64 + | 10:23::8000/113 | 10:23::ffff +(17 rows) + +-- now test some support functions +SELECT '' AS ten, i AS inet, host(i), text(i), family(i) FROM INET_TBL ORDER BY i; + ten | inet | host | text | family +-----+------------------+---------------+------------------+-------- + | 9.1.2.3/8 | 9.1.2.3 | 9.1.2.3/8 | 4 + | 10.1.2.3/8 | 10.1.2.3 | 10.1.2.3/8 | 4 + | 10.1.2.3/8 | 10.1.2.3 | 10.1.2.3/8 | 4 + | 10.1.2.3/8 | 10.1.2.3 | 10.1.2.3/8 | 4 + | 10.1.2.3/16 | 10.1.2.3 | 10.1.2.3/16 | 4 + | 10.1.2.3/24 | 10.1.2.3 | 10.1.2.3/24 | 4 + | 10.1.2.3 | 10.1.2.3 | 10.1.2.3/32 | 4 + | 11.1.2.3/8 | 11.1.2.3 | 11.1.2.3/8 | 4 + | 192.168.1.0/24 | 192.168.1.0 | 192.168.1.0/24 | 4 + | 192.168.1.226/24 | 192.168.1.226 | 192.168.1.226/24 | 4 + | 192.168.1.255/24 | 192.168.1.255 | 192.168.1.255/24 | 4 + | 192.168.1.0/25 | 192.168.1.0 | 192.168.1.0/25 | 4 + | 192.168.1.255/25 | 192.168.1.255 | 192.168.1.255/25 | 4 + | 192.168.1.226 | 192.168.1.226 | 192.168.1.226/32 | 4 + | ::4.3.2.1/24 | ::4.3.2.1 | ::4.3.2.1/24 | 6 + | 10:23::f1/64 | 10:23::f1 | 10:23::f1/64 | 6 + | 10:23::ffff | 10:23::ffff | 10:23::ffff/128 | 6 +(17 rows) + +SELECT '' AS ten, c AS cidr, broadcast(c), + i AS inet, broadcast(i) FROM INET_TBL ORDER BY i, c; + ten | cidr | broadcast | inet | broadcast +-----+--------------------+------------------+------------------+--------------------------------------- + | 10.0.0.0/8 | 10.255.255.255/8 | 9.1.2.3/8 | 9.255.255.255/8 + | 10.0.0.0/8 | 10.255.255.255/8 | 10.1.2.3/8 | 10.255.255.255/8 + | 10.0.0.0/8 | 10.255.255.255/8 | 10.1.2.3/8 | 10.255.255.255/8 + | 10.0.0.0/32 | 10.0.0.0 | 10.1.2.3/8 | 10.255.255.255/8 + | 10.1.0.0/16 | 10.1.255.255/16 | 10.1.2.3/16 | 10.1.255.255/16 + | 10.1.2.0/24 | 10.1.2.255/24 | 10.1.2.3/24 | 10.1.2.255/24 + | 10.1.2.3/32 | 10.1.2.3 | 10.1.2.3 | 10.1.2.3 + | 10.0.0.0/8 | 10.255.255.255/8 | 11.1.2.3/8 | 11.255.255.255/8 + | 192.168.1.0/24 | 192.168.1.255/24 | 192.168.1.0/24 | 192.168.1.255/24 + | 192.168.1.0/24 | 192.168.1.255/24 | 192.168.1.226/24 | 192.168.1.255/24 + | 192.168.1.0/24 | 192.168.1.255/24 | 192.168.1.255/24 | 192.168.1.255/24 + | 192.168.1.0/24 | 192.168.1.255/24 | 192.168.1.0/25 | 192.168.1.127/25 + | 192.168.1.0/24 | 192.168.1.255/24 | 192.168.1.255/25 | 192.168.1.255/25 + | 192.168.1.0/26 | 192.168.1.63/26 | 192.168.1.226 | 192.168.1.226 + | ::ffff:1.2.3.4/128 | ::ffff:1.2.3.4 | ::4.3.2.1/24 | 0:ff:ffff:ffff:ffff:ffff:ffff:ffff/24 + | 10:23::f1/128 | 10:23::f1 | 10:23::f1/64 | 10:23::ffff:ffff:ffff:ffff/64 + | 10:23::8000/113 | 10:23::ffff/113 | 10:23::ffff | 10:23::ffff +(17 rows) + +SELECT '' AS ten, c AS cidr, network(c) AS "network(cidr)", + i AS inet, network(i) AS "network(inet)" FROM INET_TBL ORDER BY i, c; + ten | cidr | network(cidr) | inet | network(inet) +-----+--------------------+--------------------+------------------+------------------ + | 10.0.0.0/8 | 10.0.0.0/8 | 9.1.2.3/8 | 9.0.0.0/8 + | 10.0.0.0/8 | 10.0.0.0/8 | 10.1.2.3/8 | 10.0.0.0/8 + | 10.0.0.0/8 | 10.0.0.0/8 | 10.1.2.3/8 | 10.0.0.0/8 + | 10.0.0.0/32 | 10.0.0.0/32 | 10.1.2.3/8 | 10.0.0.0/8 + | 10.1.0.0/16 | 10.1.0.0/16 | 10.1.2.3/16 | 10.1.0.0/16 + | 10.1.2.0/24 | 10.1.2.0/24 | 10.1.2.3/24 | 10.1.2.0/24 + | 10.1.2.3/32 | 10.1.2.3/32 | 10.1.2.3 | 10.1.2.3/32 + | 10.0.0.0/8 | 10.0.0.0/8 | 11.1.2.3/8 | 11.0.0.0/8 + | 192.168.1.0/24 | 192.168.1.0/24 | 192.168.1.0/24 | 192.168.1.0/24 + | 192.168.1.0/24 | 192.168.1.0/24 | 192.168.1.226/24 | 192.168.1.0/24 + | 192.168.1.0/24 | 192.168.1.0/24 | 192.168.1.255/24 | 192.168.1.0/24 + | 192.168.1.0/24 | 192.168.1.0/24 | 192.168.1.0/25 | 192.168.1.0/25 + | 192.168.1.0/24 | 192.168.1.0/24 | 192.168.1.255/25 | 192.168.1.128/25 + | 192.168.1.0/26 | 192.168.1.0/26 | 192.168.1.226 | 192.168.1.226/32 + | ::ffff:1.2.3.4/128 | ::ffff:1.2.3.4/128 | ::4.3.2.1/24 | ::/24 + | 10:23::f1/128 | 10:23::f1/128 | 10:23::f1/64 | 10:23::/64 + | 10:23::8000/113 | 10:23::8000/113 | 10:23::ffff | 10:23::ffff/128 +(17 rows) + +SELECT '' AS ten, c AS cidr, masklen(c) AS "masklen(cidr)", + i AS inet, masklen(i) AS "masklen(inet)" FROM INET_TBL ORDER BY i, c; + ten | cidr | masklen(cidr) | inet | masklen(inet) +-----+--------------------+---------------+------------------+--------------- + | 10.0.0.0/8 | 8 | 9.1.2.3/8 | 8 + | 10.0.0.0/8 | 8 | 10.1.2.3/8 | 8 + | 10.0.0.0/8 | 8 | 10.1.2.3/8 | 8 + | 10.0.0.0/32 | 32 | 10.1.2.3/8 | 8 + | 10.1.0.0/16 | 16 | 10.1.2.3/16 | 16 + | 10.1.2.0/24 | 24 | 10.1.2.3/24 | 24 + | 10.1.2.3/32 | 32 | 10.1.2.3 | 32 + | 10.0.0.0/8 | 8 | 11.1.2.3/8 | 8 + | 192.168.1.0/24 | 24 | 192.168.1.0/24 | 24 + | 192.168.1.0/24 | 24 | 192.168.1.226/24 | 24 + | 192.168.1.0/24 | 24 | 192.168.1.255/24 | 24 + | 192.168.1.0/24 | 24 | 192.168.1.0/25 | 25 + | 192.168.1.0/24 | 24 | 192.168.1.255/25 | 25 + | 192.168.1.0/26 | 26 | 192.168.1.226 | 32 + | ::ffff:1.2.3.4/128 | 128 | ::4.3.2.1/24 | 24 + | 10:23::f1/128 | 128 | 10:23::f1/64 | 64 + | 10:23::8000/113 | 113 | 10:23::ffff | 128 +(17 rows) + +SELECT '' AS four, c AS cidr, masklen(c) AS "masklen(cidr)", + i AS inet, masklen(i) AS "masklen(inet)" FROM INET_TBL + WHERE masklen(c) <= 8 ORDER BY i, c; + four | cidr | masklen(cidr) | inet | masklen(inet) +------+------------+---------------+------------+--------------- + | 10.0.0.0/8 | 8 | 9.1.2.3/8 | 8 + | 10.0.0.0/8 | 8 | 10.1.2.3/8 | 8 + | 10.0.0.0/8 | 8 | 10.1.2.3/8 | 8 + | 10.0.0.0/8 | 8 | 11.1.2.3/8 | 8 +(4 rows) + +SELECT '' AS six, c AS cidr, i AS inet FROM INET_TBL + WHERE c = i ORDER BY i, c; + six | cidr | inet +-----+----------------+---------------- + | 10.1.2.3/32 | 10.1.2.3 + | 192.168.1.0/24 | 192.168.1.0/24 +(2 rows) + +SELECT '' AS ten, i, c, + i < c AS lt, i <= c AS le, i = c AS eq, + i >= c AS ge, i > c AS gt, i <> c AS ne, + i << c AS sb, i <<= c AS sbe, + i >> c AS sup, i >>= c AS spe + FROM INET_TBL ORDER BY i, c; + ten | i | c | lt | le | eq | ge | gt | ne | sb | sbe | sup | spe +-----+------------------+--------------------+----+----+----+----+----+----+----+-----+-----+----- + | 9.1.2.3/8 | 10.0.0.0/8 | t | t | f | f | f | t | f | f | f | f + | 10.1.2.3/8 | 10.0.0.0/8 | f | f | f | t | t | t | f | t | f | t + | 10.1.2.3/8 | 10.0.0.0/8 | f | f | f | t | t | t | f | t | f | t + | 10.1.2.3/8 | 10.0.0.0/32 | t | t | f | f | f | t | f | f | t | t + | 10.1.2.3/16 | 10.1.0.0/16 | f | f | f | t | t | t | f | t | f | t + | 10.1.2.3/24 | 10.1.2.0/24 | f | f | f | t | t | t | f | t | f | t + | 10.1.2.3 | 10.1.2.3/32 | f | t | t | t | f | f | f | t | f | t + | 11.1.2.3/8 | 10.0.0.0/8 | f | f | f | t | t | t | f | f | f | f + | 192.168.1.0/24 | 192.168.1.0/24 | f | t | t | t | f | f | f | t | f | t + | 192.168.1.226/24 | 192.168.1.0/24 | f | f | f | t | t | t | f | t | f | t + | 192.168.1.255/24 | 192.168.1.0/24 | f | f | f | t | t | t | f | t | f | t + | 192.168.1.0/25 | 192.168.1.0/24 | f | f | f | t | t | t | t | t | f | f + | 192.168.1.255/25 | 192.168.1.0/24 | f | f | f | t | t | t | t | t | f | f + | 192.168.1.226 | 192.168.1.0/26 | f | f | f | t | t | t | f | f | f | f + | ::4.3.2.1/24 | ::ffff:1.2.3.4/128 | t | t | f | f | f | t | f | f | t | t + | 10:23::f1/64 | 10:23::f1/128 | t | t | f | f | f | t | f | f | t | t + | 10:23::ffff | 10:23::8000/113 | f | f | f | t | t | t | t | t | f | f +(17 rows) + +-- check the conversion to/from text and set_netmask +SELECT '' AS ten, set_masklen(inet(text(i)), 24) FROM INET_TBL ORDER BY i; + ten | set_masklen +-----+------------------ + | 9.1.2.3/24 + | 10.1.2.3/24 + | 10.1.2.3/24 + | 10.1.2.3/24 + | 10.1.2.3/24 + | 10.1.2.3/24 + | 10.1.2.3/24 + | 11.1.2.3/24 + | 192.168.1.0/24 + | 192.168.1.226/24 + | 192.168.1.255/24 + | 192.168.1.0/24 + | 192.168.1.255/24 + | 192.168.1.226/24 + | ::4.3.2.1/24 + | 10:23::f1/24 + | 10:23::ffff/24 +(17 rows) + +-- check that index works correctly +CREATE INDEX inet_idx1 ON inet_tbl(i); +SET enable_seqscan TO off; +SELECT * FROM inet_tbl WHERE i<<'192.168.1.0/24'::cidr ORDER BY i, c; + c | i +----------------+------------------ + 192.168.1.0/24 | 192.168.1.0/25 + 192.168.1.0/24 | 192.168.1.255/25 + 192.168.1.0/26 | 192.168.1.226 +(3 rows) + +SELECT * FROM inet_tbl WHERE i<<='192.168.1.0/24'::cidr ORDER BY i; + c | i +----------------+------------------ + 192.168.1.0/24 | 192.168.1.0/24 + 192.168.1.0/24 | 192.168.1.226/24 + 192.168.1.0/24 | 192.168.1.255/24 + 192.168.1.0/24 | 192.168.1.0/25 + 192.168.1.0/24 | 192.168.1.255/25 + 192.168.1.0/26 | 192.168.1.226 +(6 rows) + +SET enable_seqscan TO on; +DROP INDEX inet_idx1; +-- simple tests of inet boolean and arithmetic operators +SELECT i, ~i AS "~i" FROM inet_tbl ORDER BY i; + i | ~i +------------------+-------------------------------------------- + 9.1.2.3/8 | 246.254.253.252/8 + 10.1.2.3/8 | 245.254.253.252/8 + 10.1.2.3/8 | 245.254.253.252/8 + 10.1.2.3/8 | 245.254.253.252/8 + 10.1.2.3/16 | 245.254.253.252/16 + 10.1.2.3/24 | 245.254.253.252/24 + 10.1.2.3 | 245.254.253.252 + 11.1.2.3/8 | 244.254.253.252/8 + 192.168.1.0/24 | 63.87.254.255/24 + 192.168.1.226/24 | 63.87.254.29/24 + 192.168.1.255/24 | 63.87.254.0/24 + 192.168.1.0/25 | 63.87.254.255/25 + 192.168.1.255/25 | 63.87.254.0/25 + 192.168.1.226 | 63.87.254.29 + ::4.3.2.1/24 | ffff:ffff:ffff:ffff:ffff:ffff:fbfc:fdfe/24 + 10:23::f1/64 | ffef:ffdc:ffff:ffff:ffff:ffff:ffff:ff0e/64 + 10:23::ffff | ffef:ffdc:ffff:ffff:ffff:ffff:ffff:0 +(17 rows) + +SELECT i, c, i & c AS "and" FROM inet_tbl ORDER BY i, c; + i | c | and +------------------+--------------------+---------------- + 9.1.2.3/8 | 10.0.0.0/8 | 8.0.0.0/8 + 10.1.2.3/8 | 10.0.0.0/8 | 10.0.0.0/8 + 10.1.2.3/8 | 10.0.0.0/8 | 10.0.0.0/8 + 10.1.2.3/8 | 10.0.0.0/32 | 10.0.0.0 + 10.1.2.3/16 | 10.1.0.0/16 | 10.1.0.0/16 + 10.1.2.3/24 | 10.1.2.0/24 | 10.1.2.0/24 + 10.1.2.3 | 10.1.2.3/32 | 10.1.2.3 + 11.1.2.3/8 | 10.0.0.0/8 | 10.0.0.0/8 + 192.168.1.0/24 | 192.168.1.0/24 | 192.168.1.0/24 + 192.168.1.226/24 | 192.168.1.0/24 | 192.168.1.0/24 + 192.168.1.255/24 | 192.168.1.0/24 | 192.168.1.0/24 + 192.168.1.0/25 | 192.168.1.0/24 | 192.168.1.0/25 + 192.168.1.255/25 | 192.168.1.0/24 | 192.168.1.0/25 + 192.168.1.226 | 192.168.1.0/26 | 192.168.1.0 + ::4.3.2.1/24 | ::ffff:1.2.3.4/128 | ::0.2.2.0 + 10:23::f1/64 | 10:23::f1/128 | 10:23::f1 + 10:23::ffff | 10:23::8000/113 | 10:23::8000 +(17 rows) + +SELECT i, c, i | c AS "or" FROM inet_tbl ORDER BY i, c; + i | c | or +------------------+--------------------+------------------ + 9.1.2.3/8 | 10.0.0.0/8 | 11.1.2.3/8 + 10.1.2.3/8 | 10.0.0.0/8 | 10.1.2.3/8 + 10.1.2.3/8 | 10.0.0.0/8 | 10.1.2.3/8 + 10.1.2.3/8 | 10.0.0.0/32 | 10.1.2.3 + 10.1.2.3/16 | 10.1.0.0/16 | 10.1.2.3/16 + 10.1.2.3/24 | 10.1.2.0/24 | 10.1.2.3/24 + 10.1.2.3 | 10.1.2.3/32 | 10.1.2.3 + 11.1.2.3/8 | 10.0.0.0/8 | 11.1.2.3/8 + 192.168.1.0/24 | 192.168.1.0/24 | 192.168.1.0/24 + 192.168.1.226/24 | 192.168.1.0/24 | 192.168.1.226/24 + 192.168.1.255/24 | 192.168.1.0/24 | 192.168.1.255/24 + 192.168.1.0/25 | 192.168.1.0/24 | 192.168.1.0/25 + 192.168.1.255/25 | 192.168.1.0/24 | 192.168.1.255/25 + 192.168.1.226 | 192.168.1.0/26 | 192.168.1.226 + ::4.3.2.1/24 | ::ffff:1.2.3.4/128 | ::ffff:5.3.3.5 + 10:23::f1/64 | 10:23::f1/128 | 10:23::f1 + 10:23::ffff | 10:23::8000/113 | 10:23::ffff +(17 rows) + +SELECT i, i + 500 AS "i+500" FROM inet_tbl ORDER BY i; + i | i+500 +------------------+------------------ + 9.1.2.3/8 | 9.1.3.247/8 + 10.1.2.3/8 | 10.1.3.247/8 + 10.1.2.3/8 | 10.1.3.247/8 + 10.1.2.3/8 | 10.1.3.247/8 + 10.1.2.3/16 | 10.1.3.247/16 + 10.1.2.3/24 | 10.1.3.247/24 + 10.1.2.3 | 10.1.3.247 + 11.1.2.3/8 | 11.1.3.247/8 + 192.168.1.0/24 | 192.168.2.244/24 + 192.168.1.226/24 | 192.168.3.214/24 + 192.168.1.255/24 | 192.168.3.243/24 + 192.168.1.0/25 | 192.168.2.244/25 + 192.168.1.255/25 | 192.168.3.243/25 + 192.168.1.226 | 192.168.3.214 + ::4.3.2.1/24 | ::4.3.3.245/24 + 10:23::f1/64 | 10:23::2e5/64 + 10:23::ffff | 10:23::1:1f3 +(17 rows) + +SELECT i, i - 500 AS "i-500" FROM inet_tbl ORDER BY i; + i | i-500 +------------------+---------------------------------------- + 9.1.2.3/8 | 9.1.0.15/8 + 10.1.2.3/8 | 10.1.0.15/8 + 10.1.2.3/8 | 10.1.0.15/8 + 10.1.2.3/8 | 10.1.0.15/8 + 10.1.2.3/16 | 10.1.0.15/16 + 10.1.2.3/24 | 10.1.0.15/24 + 10.1.2.3 | 10.1.0.15 + 11.1.2.3/8 | 11.1.0.15/8 + 192.168.1.0/24 | 192.167.255.12/24 + 192.168.1.226/24 | 192.167.255.238/24 + 192.168.1.255/24 | 192.168.0.11/24 + 192.168.1.0/25 | 192.167.255.12/25 + 192.168.1.255/25 | 192.168.0.11/25 + 192.168.1.226 | 192.167.255.238 + ::4.3.2.1/24 | ::4.3.0.13/24 + 10:23::f1/64 | 10:22:ffff:ffff:ffff:ffff:ffff:fefd/64 + 10:23::ffff | 10:23::fe0b +(17 rows) + +SELECT i, c, i - c AS "minus" FROM inet_tbl ORDER BY i, c; + i | c | minus +------------------+--------------------+------------------ + 9.1.2.3/8 | 10.0.0.0/8 | -16711165 + 10.1.2.3/8 | 10.0.0.0/8 | 66051 + 10.1.2.3/8 | 10.0.0.0/8 | 66051 + 10.1.2.3/8 | 10.0.0.0/32 | 66051 + 10.1.2.3/16 | 10.1.0.0/16 | 515 + 10.1.2.3/24 | 10.1.2.0/24 | 3 + 10.1.2.3 | 10.1.2.3/32 | 0 + 11.1.2.3/8 | 10.0.0.0/8 | 16843267 + 192.168.1.0/24 | 192.168.1.0/24 | 0 + 192.168.1.226/24 | 192.168.1.0/24 | 226 + 192.168.1.255/24 | 192.168.1.0/24 | 255 + 192.168.1.0/25 | 192.168.1.0/24 | 0 + 192.168.1.255/25 | 192.168.1.0/24 | 255 + 192.168.1.226 | 192.168.1.0/26 | 226 + ::4.3.2.1/24 | ::ffff:1.2.3.4/128 | -281470631346435 + 10:23::f1/64 | 10:23::f1/128 | 0 + 10:23::ffff | 10:23::8000/113 | 32767 +(17 rows) + +SELECT '127.0.0.1'::inet + 257; + ?column? +----------- + 127.0.1.2 +(1 row) + +SELECT ('127.0.0.1'::inet + 257) - 257; + ?column? +----------- + 127.0.0.1 +(1 row) + +SELECT '127::1'::inet + 257; + ?column? +---------- + 127::102 +(1 row) + +SELECT ('127::1'::inet + 257) - 257; + ?column? +---------- + 127::1 +(1 row) + +SELECT '127.0.0.2'::inet - ('127.0.0.2'::inet + 500); + ?column? +---------- + -500 +(1 row) + +SELECT '127.0.0.2'::inet - ('127.0.0.2'::inet - 500); + ?column? +---------- + 500 +(1 row) + +SELECT '127::2'::inet - ('127::2'::inet + 500); + ?column? +---------- + -500 +(1 row) + +SELECT '127::2'::inet - ('127::2'::inet - 500); + ?column? +---------- + 500 +(1 row) + +-- these should give overflow errors: +SELECT '127.0.0.1'::inet + 10000000000; +ERROR: result is out of range +SELECT '127.0.0.1'::inet - 10000000000; +ERROR: result is out of range +SELECT '126::1'::inet - '127::2'::inet; +ERROR: result is out of range +SELECT '127::1'::inet - '126::2'::inet; +ERROR: result is out of range +-- but not these +SELECT '127::1'::inet + 10000000000; + ?column? +------------------ + 127::2:540b:e401 +(1 row) + +SELECT '127::1'::inet - '127::2'::inet; + ?column? +---------- + -1 +(1 row) + diff --git a/src/test/regress/sql/inet.sql b/src/test/regress/sql/inet.sql index 7ba1080..024c917 100644 --- a/src/test/regress/sql/inet.sql +++ b/src/test/regress/sql/inet.sql @@ -29,7 +29,7 @@ INSERT INTO INET_TBL (c, i) VALUES ('1234::1234::1234', '::1.2.3.4'); -- check that CIDR rejects invalid input when converting from text: INSERT INTO INET_TBL (c, i) VALUES (cidr('192.168.1.2/30'), '192.168.1.226'); INSERT INTO INET_TBL (c, i) VALUES (cidr('ffff:ffff:ffff:ffff::/24'), '::192.168.1.226'); -SELECT '' AS ten, c AS cidr, i AS inet FROM INET_TBL; +SELECT '' AS ten, c AS cidr, i AS inet FROM INET_TBL ORDER BY cidr; -- now test some support functions ----------------------------------------------------------------------- Summary of changes: src/test/regress/expected/{inet.out => inet_1.out} | 26 ++++++++++---------- src/test/regress/sql/inet.sql | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) copy src/test/regress/expected/{inet.out => inet_1.out} (99%) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-03-09 07:02:32
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via d6beeda6a68cce6f74d179e3520443be2a29bb4d (commit) from fe063aa6a39f12ce33d546f6a0730c67bee9bee8 (commit) - Log ----------------------------------------------------------------- commit d6beeda6a68cce6f74d179e3520443be2a29bb4d Author: Michael P <mic...@us...> Date: Wed Mar 9 16:01:05 2011 +0900 Fix for regression test returning TEMP tables are not supported so this test has to return error messages in consequence. diff --git a/src/test/regress/expected/returning_1.out b/src/test/regress/expected/returning_1.out new file mode 100644 index 0000000..42be497 --- /dev/null +++ b/src/test/regress/expected/returning_1.out @@ -0,0 +1,265 @@ +-- +-- Test INSERT/UPDATE/DELETE RETURNING +-- +-- Simple cases +CREATE TEMP TABLE foo (f1 serial, f2 text, f3 int default 42); +NOTICE: CREATE TABLE will create implicit sequence "foo_f1_seq" for serial column "foo.f1" +ERROR: PG-XC does not yet support temporary tables +INSERT INTO foo (f2,f3) + VALUES ('test', DEFAULT), ('More', 11), (upper('more'), 7+9) + RETURNING *, f1+f3 AS sum; +ERROR: relation "foo" does not exist +LINE 1: INSERT INTO foo (f2,f3) + ^ +SELECT * FROM foo ORDER BY f1; +ERROR: relation "foo" does not exist +LINE 1: SELECT * FROM foo ORDER BY f1; + ^ +UPDATE foo SET f2 = lower(f2), f3 = DEFAULT RETURNING foo.*, f1+f3 AS sum13; +ERROR: relation "foo" does not exist +LINE 1: UPDATE foo SET f2 = lower(f2), f3 = DEFAULT RETURNING foo.*,... + ^ +SELECT * FROM foo ORDER BY f1; +ERROR: relation "foo" does not exist +LINE 1: SELECT * FROM foo ORDER BY f1; + ^ +DELETE FROM foo WHERE f1 > 2 RETURNING f3, f2, f1, least(f1,f3); +ERROR: relation "foo" does not exist +LINE 1: DELETE FROM foo WHERE f1 > 2 RETURNING f3, f2, f1, least(f1,... + ^ +SELECT * FROM foo ORDER BY f1; +ERROR: relation "foo" does not exist +LINE 1: SELECT * FROM foo ORDER BY f1; + ^ +-- Subplans and initplans in the RETURNING list +INSERT INTO foo SELECT f1+10, f2, f3+99 FROM foo + RETURNING *, f1+112 IN (SELECT q1 FROM int8_tbl) AS subplan, + EXISTS(SELECT * FROM int4_tbl) AS initplan; +ERROR: relation "foo" does not exist +LINE 1: INSERT INTO foo SELECT f1+10, f2, f3+99 FROM foo + ^ +UPDATE foo SET f3 = f3 * 2 + WHERE f1 > 10 + RETURNING *, f1+112 IN (SELECT q1 FROM int8_tbl) AS subplan, + EXISTS(SELECT * FROM int4_tbl) AS initplan; +ERROR: relation "foo" does not exist +LINE 1: UPDATE foo SET f3 = f3 * 2 + ^ +DELETE FROM foo + WHERE f1 > 10 + RETURNING *, f1+112 IN (SELECT q1 FROM int8_tbl) AS subplan, + EXISTS(SELECT * FROM int4_tbl) AS initplan; +ERROR: relation "foo" does not exist +LINE 1: DELETE FROM foo + ^ +-- Joins +UPDATE foo SET f3 = f3*2 + FROM int4_tbl i + WHERE foo.f1 + 123455 = i.f1 + RETURNING foo.*, i.f1 as "i.f1"; +ERROR: relation "foo" does not exist +LINE 1: UPDATE foo SET f3 = f3*2 + ^ +SELECT * FROM foo ORDER BY f1; +ERROR: relation "foo" does not exist +LINE 1: SELECT * FROM foo ORDER BY f1; + ^ +DELETE FROM foo + USING int4_tbl i + WHERE foo.f1 + 123455 = i.f1 + RETURNING foo.*, i.f1 as "i.f1"; +ERROR: relation "foo" does not exist +LINE 1: DELETE FROM foo + ^ +SELECT * FROM foo ORDER BY f1; +ERROR: relation "foo" does not exist +LINE 1: SELECT * FROM foo ORDER BY f1; + ^ +-- Check inheritance cases +CREATE TEMP TABLE foochild (fc int) INHERITS (foo); +ERROR: PG-XC does not yet support temporary tables +INSERT INTO foochild VALUES(123,'child',999,-123); +ERROR: relation "foochild" does not exist +LINE 1: INSERT INTO foochild VALUES(123,'child',999,-123); + ^ +ALTER TABLE foo ADD COLUMN f4 int8 DEFAULT 99; +ERROR: relation "foo" does not exist +SELECT * FROM foo ORDER BY f1; +ERROR: relation "foo" does not exist +LINE 1: SELECT * FROM foo ORDER BY f1; + ^ +SELECT * FROM foochild ORDER BY f1; +ERROR: relation "foochild" does not exist +LINE 1: SELECT * FROM foochild ORDER BY f1; + ^ +UPDATE foo SET f4 = f4 + f3 WHERE f4 = 99 RETURNING *; +ERROR: relation "foo" does not exist +LINE 1: UPDATE foo SET f4 = f4 + f3 WHERE f4 = 99 RETURNING *; + ^ +SELECT * FROM foo ORDER BY f1; +ERROR: relation "foo" does not exist +LINE 1: SELECT * FROM foo ORDER BY f1; + ^ +SELECT * FROM foochild ORDER BY f1; +ERROR: relation "foochild" does not exist +LINE 1: SELECT * FROM foochild ORDER BY f1; + ^ +UPDATE foo SET f3 = f3*2 + FROM int8_tbl i + WHERE foo.f1 = i.q2 + RETURNING *; +ERROR: relation "foo" does not exist +LINE 1: UPDATE foo SET f3 = f3*2 + ^ +SELECT * FROM foo ORDER BY f1; +ERROR: relation "foo" does not exist +LINE 1: SELECT * FROM foo ORDER BY f1; + ^ +SELECT * FROM foochild ORDER BY f1; +ERROR: relation "foochild" does not exist +LINE 1: SELECT * FROM foochild ORDER BY f1; + ^ +DELETE FROM foo + USING int8_tbl i + WHERE foo.f1 = i.q2 + RETURNING *; +ERROR: relation "foo" does not exist +LINE 1: DELETE FROM foo + ^ +SELECT * FROM foo ORDER BY f1; +ERROR: relation "foo" does not exist +LINE 1: SELECT * FROM foo ORDER BY f1; + ^ +SELECT * FROM foochild ORDER BY f1; +ERROR: relation "foochild" does not exist +LINE 1: SELECT * FROM foochild ORDER BY f1; + ^ +DROP TABLE foochild; +ERROR: table "foochild" does not exist +-- Rules and views +CREATE TEMP VIEW voo AS SELECT f1, f2 FROM foo; +ERROR: relation "foo" does not exist +LINE 1: CREATE TEMP VIEW voo AS SELECT f1, f2 FROM foo; + ^ +CREATE RULE voo_i AS ON INSERT TO voo DO INSTEAD + INSERT INTO foo VALUES(new.*, 57); +ERROR: relation "voo" does not exist +INSERT INTO voo VALUES(11,'zit'); +ERROR: relation "voo" does not exist +LINE 1: INSERT INTO voo VALUES(11,'zit'); + ^ +-- fails: +INSERT INTO voo VALUES(12,'zoo') RETURNING *, f1*2; +ERROR: relation "voo" does not exist +LINE 1: INSERT INTO voo VALUES(12,'zoo') RETURNING *, f1*2; + ^ +-- fails, incompatible list: +CREATE OR REPLACE RULE voo_i AS ON INSERT TO voo DO INSTEAD + INSERT INTO foo VALUES(new.*, 57) RETURNING *; +ERROR: relation "voo" does not exist +CREATE OR REPLACE RULE voo_i AS ON INSERT TO voo DO INSTEAD + INSERT INTO foo VALUES(new.*, 57) RETURNING f1, f2; +ERROR: relation "voo" does not exist +-- should still work +INSERT INTO voo VALUES(13,'zit2'); +ERROR: relation "voo" does not exist +LINE 1: INSERT INTO voo VALUES(13,'zit2'); + ^ +-- works now +INSERT INTO voo VALUES(14,'zoo2') RETURNING *; +ERROR: relation "voo" does not exist +LINE 1: INSERT INTO voo VALUES(14,'zoo2') RETURNING *; + ^ +SELECT * FROM foo ORDER BY f1; +ERROR: relation "foo" does not exist +LINE 1: SELECT * FROM foo ORDER BY f1; + ^ +SELECT * FROM voo ORDER BY f1; +ERROR: relation "voo" does not exist +LINE 1: SELECT * FROM voo ORDER BY f1; + ^ +CREATE OR REPLACE RULE voo_u AS ON UPDATE TO voo DO INSTEAD + UPDATE foo SET f1 = new.f1, f2 = new.f2 WHERE f1 = old.f1 + RETURNING f1, f2; +ERROR: relation "voo" does not exist +update voo set f1 = f1 + 1 where f2 = 'zoo2'; +ERROR: relation "voo" does not exist +LINE 1: update voo set f1 = f1 + 1 where f2 = 'zoo2'; + ^ +update voo set f1 = f1 + 1 where f2 = 'zoo2' RETURNING *, f1*2; +ERROR: relation "voo" does not exist +LINE 1: update voo set f1 = f1 + 1 where f2 = 'zoo2' RETURNING *, f1... + ^ +SELECT * FROM foo ORDER BY f1; +ERROR: relation "foo" does not exist +LINE 1: SELECT * FROM foo ORDER BY f1; + ^ +SELECT * FROM voo ORDER BY f1; +ERROR: relation "voo" does not exist +LINE 1: SELECT * FROM voo ORDER BY f1; + ^ +CREATE OR REPLACE RULE voo_d AS ON DELETE TO voo DO INSTEAD + DELETE FROM foo WHERE f1 = old.f1 + RETURNING f1, f2; +ERROR: relation "voo" does not exist +DELETE FROM foo WHERE f1 = 13; +ERROR: relation "foo" does not exist +LINE 1: DELETE FROM foo WHERE f1 = 13; + ^ +DELETE FROM foo WHERE f2 = 'zit' RETURNING *; +ERROR: relation "foo" does not exist +LINE 1: DELETE FROM foo WHERE f2 = 'zit' RETURNING *; + ^ +SELECT * FROM foo ORDER BY f1; +ERROR: relation "foo" does not exist +LINE 1: SELECT * FROM foo ORDER BY f1; + ^ +SELECT * FROM voo ORDER BY f1; +ERROR: relation "voo" does not exist +LINE 1: SELECT * FROM voo ORDER BY f1; + ^ +-- Try a join case +CREATE TEMP TABLE joinme (f2j text, other int); +ERROR: PG-XC does not yet support temporary tables +INSERT INTO joinme VALUES('more', 12345); +ERROR: relation "joinme" does not exist +LINE 1: INSERT INTO joinme VALUES('more', 12345); + ^ +INSERT INTO joinme VALUES('zoo2', 54321); +ERROR: relation "joinme" does not exist +LINE 1: INSERT INTO joinme VALUES('zoo2', 54321); + ^ +INSERT INTO joinme VALUES('other', 0); +ERROR: relation "joinme" does not exist +LINE 1: INSERT INTO joinme VALUES('other', 0); + ^ +CREATE TEMP VIEW joinview AS + SELECT foo.*, other FROM foo JOIN joinme ON (f2 = f2j); +ERROR: relation "foo" does not exist +LINE 2: SELECT foo.*, other FROM foo JOIN joinme ON (f2 = f2j); + ^ +SELECT * FROM joinview ORDER BY f1; +ERROR: relation "joinview" does not exist +LINE 1: SELECT * FROM joinview ORDER BY f1; + ^ +CREATE RULE joinview_u AS ON UPDATE TO joinview DO INSTEAD + UPDATE foo SET f1 = new.f1, f3 = new.f3 + FROM joinme WHERE f2 = f2j AND f2 = old.f2 + RETURNING foo.*, other; +ERROR: relation "joinview" does not exist +UPDATE joinview SET f1 = f1 + 1 WHERE f3 = 57 RETURNING *, other + 1; +ERROR: relation "joinview" does not exist +LINE 1: UPDATE joinview SET f1 = f1 + 1 WHERE f3 = 57 RETURNING *, o... + ^ +SELECT * FROM joinview ORDER BY f1; +ERROR: relation "joinview" does not exist +LINE 1: SELECT * FROM joinview ORDER BY f1; + ^ +SELECT * FROM foo ORDER BY f1; +ERROR: relation "foo" does not exist +LINE 1: SELECT * FROM foo ORDER BY f1; + ^ +SELECT * FROM voo ORDER BY f1; +ERROR: relation "voo" does not exist +LINE 1: SELECT * FROM voo ORDER BY f1; + ^ ----------------------------------------------------------------------- Summary of changes: src/test/regress/expected/returning_1.out | 265 +++++++++++++++++++++++++++++ 1 files changed, 265 insertions(+), 0 deletions(-) create mode 100644 src/test/regress/expected/returning_1.out hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-03-09 06:47:26
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via fe063aa6a39f12ce33d546f6a0730c67bee9bee8 (commit) from 6683a32a11ff2380ec743db49a52bc297acd14cb (commit) - Log ----------------------------------------------------------------- commit fe063aa6a39f12ce33d546f6a0730c67bee9bee8 Author: Michael P <mic...@us...> Date: Wed Mar 9 15:46:08 2011 +0900 Fix for regression test create_table A couple of NOTICE messages were missing diff --git a/src/test/regress/expected/create_table_1.out b/src/test/regress/expected/create_table_1.out index 76a1b71..6728a0c 100644 --- a/src/test/regress/expected/create_table_1.out +++ b/src/test/regress/expected/create_table_1.out @@ -81,15 +81,15 @@ CREATE TABLE student ( CREATE TABLE stud_emp ( percent int4 ) INHERITS (emp, student); +NOTICE: merging multiple inherited definitions of column "name" +NOTICE: merging multiple inherited definitions of column "age" +NOTICE: merging multiple inherited definitions of column "location" ERROR: Cannot currently distribute a table with more than one parent. CREATE TABLE city ( name name, location box, budget city_budget ); -ERROR: type "city_budget" does not exist -LINE 4: budget city_budget - ^ CREATE TABLE dept ( dname name, mgrname text @@ -136,6 +136,8 @@ CREATE TABLE c_star ( CREATE TABLE d_star ( d float8 ) INHERITS (b_star, c_star); +NOTICE: merging multiple inherited definitions of column "class" +NOTICE: merging multiple inherited definitions of column "a" ERROR: Cannot currently distribute a table with more than one parent. CREATE TABLE e_star ( e int2 ----------------------------------------------------------------------- Summary of changes: src/test/regress/expected/create_table_1.out | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-03-09 04:33:21
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via 6683a32a11ff2380ec743db49a52bc297acd14cb (commit) from aadbdfe18024455d5e18cf9007de5b8a3f5135dc (commit) - Log ----------------------------------------------------------------- commit 6683a32a11ff2380ec743db49a52bc297acd14cb Author: Michael P <mic...@us...> Date: Wed Mar 9 13:30:50 2011 +0900 Cleanup of regression files Some files that have been autogenerated by pg_regress have been kept in repository diff --git a/src/test/regress/expected/constraints.out b/src/test/regress/expected/constraints.out deleted file mode 100644 index d7a988a..0000000 --- a/src/test/regress/expected/constraints.out +++ /dev/null @@ -1,377 +0,0 @@ --- --- CONSTRAINTS --- Constraints can be specified with: --- - DEFAULT clause --- - CHECK clauses --- - PRIMARY KEY clauses --- - UNIQUE clauses --- --- --- DEFAULT syntax --- -CREATE TABLE DEFAULT_TBL (i int DEFAULT 100, - x text DEFAULT 'vadim', f float8 DEFAULT 123.456); -INSERT INTO DEFAULT_TBL VALUES (1, 'thomas', 57.0613); -INSERT INTO DEFAULT_TBL VALUES (1, 'bruce'); -INSERT INTO DEFAULT_TBL (i, f) VALUES (2, 987.654); -INSERT INTO DEFAULT_TBL (x) VALUES ('marc'); -INSERT INTO DEFAULT_TBL VALUES (3, null, 1.0); -SELECT '' AS five, * FROM DEFAULT_TBL ORDER BY i,x,f; - five | i | x | f -------+-----+--------+--------- - | 1 | bruce | 123.456 - | 1 | thomas | 57.0613 - | 2 | vadim | 987.654 - | 3 | | 1 - | 100 | marc | 123.456 -(5 rows) - -CREATE SEQUENCE DEFAULT_SEQ; -CREATE TABLE DEFAULTEXPR_TBL (i1 int DEFAULT 100 + (200-199) * 2, - i2 int DEFAULT nextval('default_seq')); -INSERT INTO DEFAULTEXPR_TBL VALUES (-1, -2); -INSERT INTO DEFAULTEXPR_TBL (i1) VALUES (-3); -INSERT INTO DEFAULTEXPR_TBL (i2) VALUES (-4); -INSERT INTO DEFAULTEXPR_TBL (i2) VALUES (NULL); -SELECT '' AS four, * FROM DEFAULTEXPR_TBL ORDER BY i1,i2; - four | i1 | i2 -------+-----+---- - | -3 | 1 - | -1 | -2 - | 102 | -4 - | 102 | -(4 rows) - --- syntax errors --- test for extraneous comma -CREATE TABLE error_tbl (i int DEFAULT (100, )); -ERROR: syntax error at or near ")" -LINE 1: CREATE TABLE error_tbl (i int DEFAULT (100, )); - ^ --- this will fail because gram.y uses b_expr not a_expr for defaults, --- to avoid a shift/reduce conflict that arises from NOT NULL being --- part of the column definition syntax: -CREATE TABLE error_tbl (b1 bool DEFAULT 1 IN (1, 2)); -ERROR: syntax error at or near "IN" -LINE 1: CREATE TABLE error_tbl (b1 bool DEFAULT 1 IN (1, 2)); - ^ --- this should work, however: -CREATE TABLE error_tbl (b1 bool DEFAULT (1 IN (1, 2))); -DROP TABLE error_tbl; --- --- CHECK syntax --- -CREATE TABLE CHECK_TBL (x int, - CONSTRAINT CHECK_CON CHECK (x > 3)); -INSERT INTO CHECK_TBL VALUES (5); -INSERT INTO CHECK_TBL VALUES (4); -INSERT INTO CHECK_TBL VALUES (3); -ERROR: new row for relation "check_tbl" violates check constraint "check_con" -INSERT INTO CHECK_TBL VALUES (2); -ERROR: new row for relation "check_tbl" violates check constraint "check_con" -INSERT INTO CHECK_TBL VALUES (6); -INSERT INTO CHECK_TBL VALUES (1); -ERROR: new row for relation "check_tbl" violates check constraint "check_con" -SELECT '' AS three, * FROM CHECK_TBL ORDER BY x; - three | x --------+--- - | 4 - | 5 - | 6 -(3 rows) - -CREATE SEQUENCE CHECK_SEQ; -CREATE TABLE CHECK2_TBL (x int, y text, z int, - CONSTRAINT SEQUENCE_CON - CHECK (x > 3 and y <> 'check failed' and z < 8)); -INSERT INTO CHECK2_TBL VALUES (4, 'check ok', -2); -INSERT INTO CHECK2_TBL VALUES (1, 'x check failed', -2); -ERROR: new row for relation "check2_tbl" violates check constraint "sequence_con" -INSERT INTO CHECK2_TBL VALUES (5, 'z check failed', 10); -ERROR: new row for relation "check2_tbl" violates check constraint "sequence_con" -INSERT INTO CHECK2_TBL VALUES (0, 'check failed', -2); -ERROR: new row for relation "check2_tbl" violates check constraint "sequence_con" -INSERT INTO CHECK2_TBL VALUES (6, 'check failed', 11); -ERROR: new row for relation "check2_tbl" violates check constraint "sequence_con" -INSERT INTO CHECK2_TBL VALUES (7, 'check ok', 7); -SELECT '' AS two, * from CHECK2_TBL ORDER BY x,y,z; - two | x | y | z ------+---+----------+---- - | 4 | check ok | -2 - | 7 | check ok | 7 -(2 rows) - --- --- Check constraints on INSERT --- -CREATE SEQUENCE INSERT_SEQ; -CREATE TABLE INSERT_TBL (x INT DEFAULT nextval('insert_seq'), - y TEXT DEFAULT '-NULL-', - z INT DEFAULT -1 * currval('insert_seq'), - CONSTRAINT INSERT_CON CHECK (x >= 3 AND y <> 'check failed' AND x < 8), - CHECK (x + z = 0)); -INSERT INTO INSERT_TBL(x,z) VALUES (2, -2); -ERROR: new row for relation "insert_tbl" violates check constraint "insert_con" -SELECT '' AS zero, * FROM INSERT_TBL order by x,y,z; - zero | x | y | z -------+---+---+--- -(0 rows) - -SELECT 'one' AS one, nextval('insert_seq'); - one | nextval ------+--------- - one | 1 -(1 row) - -INSERT INTO INSERT_TBL(y) VALUES ('Y'); -ERROR: new row for relation "insert_tbl" violates check constraint "insert_con" -INSERT INTO INSERT_TBL(y) VALUES ('Y'); -INSERT INTO INSERT_TBL(x,z) VALUES (1, -2); -ERROR: new row for relation "insert_tbl" violates check constraint "insert_tbl_check" -INSERT INTO INSERT_TBL(z,x) VALUES (-7, 7); -INSERT INTO INSERT_TBL VALUES (5, 'check failed', -5); -ERROR: new row for relation "insert_tbl" violates check constraint "insert_con" -INSERT INTO INSERT_TBL VALUES (7, '!check failed', -7); -INSERT INTO INSERT_TBL(y) VALUES ('-!NULL-'); -SELECT '' AS four, * FROM INSERT_TBL order by x,y,z; - four | x | y | z -------+---+---------------+---- - | 3 | Y | -3 - | 4 | -!NULL- | -4 - | 7 | !check failed | -7 - | 7 | -NULL- | -7 -(4 rows) - -INSERT INTO INSERT_TBL(y,z) VALUES ('check failed', 4); -ERROR: new row for relation "insert_tbl" violates check constraint "insert_tbl_check" -INSERT INTO INSERT_TBL(x,y) VALUES (5, 'check failed'); -ERROR: new row for relation "insert_tbl" violates check constraint "insert_con" -INSERT INTO INSERT_TBL(x,y) VALUES (5, '!check failed'); -INSERT INTO INSERT_TBL(y) VALUES ('-!NULL-'); -SELECT '' AS six, * FROM INSERT_TBL order by x,y,z; - six | x | y | z ------+---+---------------+---- - | 3 | Y | -3 - | 4 | -!NULL- | -4 - | 5 | !check failed | -5 - | 6 | -!NULL- | -6 - | 7 | !check failed | -7 - | 7 | -NULL- | -7 -(6 rows) - -SELECT 'seven' AS one, nextval('insert_seq'); - one | nextval --------+--------- - seven | 7 -(1 row) - -INSERT INTO INSERT_TBL(y) VALUES ('Y'); -ERROR: new row for relation "insert_tbl" violates check constraint "insert_con" -SELECT 'eight' AS one, currval('insert_seq'); - one | currval --------+--------- - eight | 8 -(1 row) - --- According to SQL92, it is OK to insert a record that gives rise to NULL --- constraint-condition results. Postgres used to reject this, but it --- was wrong: -INSERT INTO INSERT_TBL VALUES (null, null, null); -SELECT '' AS nine, * FROM INSERT_TBL order by x,y,z; - nine | x | y | z -------+---+---------------+---- - | 3 | Y | -3 - | 4 | -!NULL- | -4 - | 5 | !check failed | -5 - | 6 | -!NULL- | -6 - | 7 | !check failed | -7 - | 7 | -NULL- | -7 - | | | -(7 rows) - --- --- Check inheritance of defaults and constraints --- -CREATE TABLE INSERT_CHILD (cx INT default 42, - cy INT CHECK (cy > x)) - INHERITS (INSERT_TBL); -INSERT INTO INSERT_CHILD(x,z,cy) VALUES (7,-7,11); -INSERT INTO INSERT_CHILD(x,z,cy) VALUES (7,-7,6); -ERROR: new row for relation "insert_child" violates check constraint "insert_child_check" -INSERT INTO INSERT_CHILD(x,z,cy) VALUES (6,-7,7); -ERROR: new row for relation "insert_child" violates check constraint "insert_tbl_check" -INSERT INTO INSERT_CHILD(x,y,z,cy) VALUES (6,'check failed',-6,7); -ERROR: new row for relation "insert_child" violates check constraint "insert_con" -SELECT * FROM INSERT_CHILD order by 1,2,3; - x | y | z | cx | cy ----+--------+----+----+---- - 7 | -NULL- | -7 | 42 | 11 -(1 row) - -DROP TABLE INSERT_CHILD; --- --- Check constraints on INSERT INTO --- -DELETE FROM INSERT_TBL; -ALTER SEQUENCE INSERT_SEQ RESTART WITH 4; -CREATE TABLE tmp (xd INT, yd TEXT, zd INT); -INSERT INTO tmp VALUES (null, 'Y', null); -INSERT INTO tmp VALUES (5, '!check failed', null); -INSERT INTO tmp VALUES (null, 'try again', null); -INSERT INTO INSERT_TBL(y) select yd from tmp; -SELECT '' AS three, * FROM INSERT_TBL order by x,y,z; - three | x | y | z --------+---+---------------+---- - | 4 | Y | -4 - | 5 | !check failed | -5 - | 6 | try again | -6 -(3 rows) - -INSERT INTO INSERT_TBL SELECT * FROM tmp WHERE yd = 'try again'; -INSERT INTO INSERT_TBL(y,z) SELECT yd, -7 FROM tmp WHERE yd = 'try again'; -INSERT INTO INSERT_TBL(y,z) SELECT yd, -8 FROM tmp WHERE yd = 'try again'; -ERROR: new row for relation "insert_tbl" violates check constraint "insert_con" -SELECT '' AS four, * FROM INSERT_TBL order by x,y,z; - four | x | y | z -------+---+---------------+---- - | 4 | Y | -4 - | 5 | !check failed | -5 - | 6 | try again | -6 - | 7 | try again | -7 - | | try again | -(5 rows) - -DROP TABLE tmp; --- --- Check constraints on UPDATE --- -UPDATE INSERT_TBL SET x = NULL WHERE x = 5; -UPDATE INSERT_TBL SET x = 6 WHERE x = 6; -UPDATE INSERT_TBL SET x = -z, z = -x; -UPDATE INSERT_TBL SET x = z, z = x; -ERROR: new row for relation "insert_tbl" violates check constraint "insert_con" -SELECT * FROM INSERT_TBL order by x,y,z; - x | y | z ----+---------------+---- - 4 | Y | -4 - 5 | !check failed | - 6 | try again | -6 - 7 | try again | -7 - | try again | -(5 rows) - --- DROP TABLE INSERT_TBL; --- --- Check constraints on COPY FROM --- -CREATE TABLE COPY_TBL (x INT, y TEXT, z INT, - CONSTRAINT COPY_CON - CHECK (x > 3 AND y <> 'check failed' AND x < 7 )); -COPY COPY_TBL FROM '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/data/constro.data'; -SELECT '' AS two, * FROM COPY_TBL order by x,y,z; - two | x | y | z ------+---+---------------+--- - | 4 | !check failed | 5 - | 6 | OK | 4 -(2 rows) - -COPY COPY_TBL FROM '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/data/constrf.data'; -ERROR: new row for relation "copy_tbl" violates check constraint "copy_con" -CONTEXT: COPY copy_tbl, line 2: "7 check failed 6" -SELECT * FROM COPY_TBL order by x,y,z; - x | y | z ----+---------------+--- - 4 | !check failed | 5 - 6 | OK | 4 -(2 rows) - --- --- Primary keys --- -CREATE TABLE PRIMARY_TBL (i int PRIMARY KEY, t text); -NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "primary_tbl_pkey" for table "primary_tbl" -INSERT INTO PRIMARY_TBL VALUES (1, 'one'); -INSERT INTO PRIMARY_TBL VALUES (2, 'two'); -INSERT INTO PRIMARY_TBL VALUES (1, 'three'); -ERROR: duplicate key value violates unique constraint "primary_tbl_pkey" -INSERT INTO PRIMARY_TBL VALUES (4, 'three'); -INSERT INTO PRIMARY_TBL VALUES (5, 'one'); -INSERT INTO PRIMARY_TBL (t) VALUES ('six'); -ERROR: null value in column "i" violates not-null constraint -SELECT '' AS four, * FROM PRIMARY_TBL order by i,t; - four | i | t -------+---+------- - | 1 | one - | 2 | two - | 4 | three - | 5 | one -(4 rows) - -DROP TABLE PRIMARY_TBL; -CREATE TABLE PRIMARY_TBL (i int, t text, - PRIMARY KEY(i,t)); -NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "primary_tbl_pkey" for table "primary_tbl" -INSERT INTO PRIMARY_TBL VALUES (1, 'one'); -INSERT INTO PRIMARY_TBL VALUES (2, 'two'); -INSERT INTO PRIMARY_TBL VALUES (1, 'three'); -INSERT INTO PRIMARY_TBL VALUES (4, 'three'); -INSERT INTO PRIMARY_TBL VALUES (5, 'one'); -INSERT INTO PRIMARY_TBL (t) VALUES ('six'); -ERROR: null value in column "i" violates not-null constraint -SELECT '' AS three, * FROM PRIMARY_TBL order by i,t; - three | i | t --------+---+------- - | 1 | one - | 1 | three - | 2 | two - | 4 | three - | 5 | one -(5 rows) - -DROP TABLE PRIMARY_TBL; --- --- Unique keys --- -CREATE TABLE UNIQUE_TBL (i int UNIQUE, t text); -NOTICE: CREATE TABLE / UNIQUE will create implicit index "unique_tbl_i_key" for table "unique_tbl" -INSERT INTO UNIQUE_TBL VALUES (1, 'one'); -INSERT INTO UNIQUE_TBL VALUES (2, 'two'); -INSERT INTO UNIQUE_TBL VALUES (1, 'three'); -ERROR: duplicate key value violates unique constraint "unique_tbl_i_key" -INSERT INTO UNIQUE_TBL VALUES (4, 'four'); -INSERT INTO UNIQUE_TBL VALUES (5, 'one'); -INSERT INTO UNIQUE_TBL (t) VALUES ('six'); -INSERT INTO UNIQUE_TBL (t) VALUES ('seven'); -SELECT '' AS five, * FROM UNIQUE_TBL order by i,t; - five | i | t -------+---+------- - | 1 | one - | 2 | two - | 4 | four - | 5 | one - | | seven - | | six -(6 rows) - -DROP TABLE UNIQUE_TBL; -CREATE TABLE UNIQUE_TBL (i int, t text, - UNIQUE(i,t)); -NOTICE: CREATE TABLE / UNIQUE will create implicit index "unique_tbl_i_key" for table "unique_tbl" -INSERT INTO UNIQUE_TBL VALUES (1, 'one'); -INSERT INTO UNIQUE_TBL VALUES (2, 'two'); -INSERT INTO UNIQUE_TBL VALUES (1, 'three'); -INSERT INTO UNIQUE_TBL VALUES (1, 'one'); -ERROR: duplicate key value violates unique constraint "unique_tbl_i_key" -INSERT INTO UNIQUE_TBL VALUES (5, 'one'); -INSERT INTO UNIQUE_TBL (t) VALUES ('six'); -SELECT '' AS five, * FROM UNIQUE_TBL order by i,t; - five | i | t -------+---+------- - | 1 | one - | 1 | three - | 2 | two - | 5 | one - | | six -(5 rows) - -DROP TABLE UNIQUE_TBL; diff --git a/src/test/regress/expected/copy.out b/src/test/regress/expected/copy.out deleted file mode 100644 index 96c639d..0000000 --- a/src/test/regress/expected/copy.out +++ /dev/null @@ -1,73 +0,0 @@ --- --- COPY --- --- CLASS POPULATION --- (any resemblance to real life is purely coincidental) --- -COPY aggtest FROM '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/data/agg.data'; -COPY onek FROM '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/data/onek.data'; -COPY onek TO '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/results/onek.data'; -DELETE FROM onek; -COPY onek FROM '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/results/onek.data'; -COPY tenk1 FROM '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/data/tenk.data'; -COPY slow_emp4000 FROM '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/data/rect.data'; -COPY person FROM '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/data/person.data'; -COPY emp FROM '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/data/emp.data'; -COPY student FROM '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/data/student.data'; -COPY stud_emp FROM '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/data/stud_emp.data'; -COPY road FROM '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/data/streets.data'; -COPY real_city FROM '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/data/real_city.data'; -COPY hash_i4_heap FROM '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/data/hash.data'; -COPY hash_name_heap FROM '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/data/hash.data'; -COPY hash_txt_heap FROM '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/data/hash.data'; -COPY hash_f8_heap FROM '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/data/hash.data'; -COPY test_tsvector FROM '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/data/tsearch.data'; --- the data in this file has a lot of duplicates in the index key --- fields, leading to long bucket chains and lots of table expansion. --- this is therefore a stress test of the bucket overflow code (unlike --- the data in hash.data, which has unique index keys). --- --- COPY hash_ovfl_heap FROM '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/data/hashovfl.data'; -COPY bt_i4_heap FROM '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/data/desc.data'; -COPY bt_name_heap FROM '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/data/hash.data'; -COPY bt_txt_heap FROM '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/data/desc.data'; -COPY bt_f8_heap FROM '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/data/hash.data'; -COPY array_op_test FROM '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/data/array.data'; -COPY array_index_op_test FROM '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/data/array.data'; ---- test copying in CSV mode with various styles ---- of embedded line ending characters -create temp table copytest ( - style text, - test text, - filler int); -insert into copytest values('DOS',E'abc\r\ndef',1); -insert into copytest values('Unix',E'abc\ndef',2); -insert into copytest values('Mac',E'abc\rdef',3); -insert into copytest values(E'esc\\ape',E'a\\r\\\r\\\n\\nb',4); -copy copytest to '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/results/copytest.csv' csv; -create temp table copytest2 (like copytest); -copy copytest2 from '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/results/copytest.csv' csv; -select * from copytest except select * from copytest2; - style | test | filler --------+------+-------- -(0 rows) - -truncate copytest2; ---- same test but with an escape char different from quote char -copy copytest to '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/results/copytest.csv' csv quote '''' escape E'\\'; -copy copytest2 from '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/results/copytest.csv' csv quote '''' escape E'\\'; -select * from copytest except select * from copytest2; - style | test | filler --------+------+-------- -(0 rows) - --- test header line feature -create temp table copytest3 ( - c1 int, - "col with , comma" text, - "col with "" quote" int); -copy copytest3 from stdin csv header; -copy copytest3 to stdout csv header; -c1,"col with , comma","col with "" quote" -1,a,1 -2,b,2 diff --git a/src/test/regress/expected/create_function_1.out b/src/test/regress/expected/create_function_1.out deleted file mode 100644 index e30788d..0000000 --- a/src/test/regress/expected/create_function_1.out +++ /dev/null @@ -1,82 +0,0 @@ --- --- CREATE_FUNCTION_1 --- -CREATE FUNCTION widget_in(cstring) - RETURNS widget - AS '/Users/masonsharp/dev/pgxc/postgres-xc/inst/lib/regress.so' - LANGUAGE C STRICT; -NOTICE: type "widget" is not yet defined -DETAIL: Creating a shell type definition. -CREATE FUNCTION widget_out(widget) - RETURNS cstring - AS '/Users/masonsharp/dev/pgxc/postgres-xc/inst/lib/regress.so' - LANGUAGE C STRICT; -NOTICE: argument type widget is only a shell -CREATE FUNCTION int44in(cstring) - RETURNS city_budget - AS '/Users/masonsharp/dev/pgxc/postgres-xc/inst/lib/regress.so' - LANGUAGE C STRICT; -NOTICE: type "city_budget" is not yet defined -DETAIL: Creating a shell type definition. -CREATE FUNCTION int44out(city_budget) - RETURNS cstring - AS '/Users/masonsharp/dev/pgxc/postgres-xc/inst/lib/regress.so' - LANGUAGE C STRICT; -NOTICE: argument type city_budget is only a shell -CREATE FUNCTION check_primary_key () - RETURNS trigger - AS '/Users/masonsharp/dev/pgxc/postgres-xc/inst/lib/refint.so' - LANGUAGE C; -CREATE FUNCTION check_foreign_key () - RETURNS trigger - AS '/Users/masonsharp/dev/pgxc/postgres-xc/inst/lib/refint.so' - LANGUAGE C; -CREATE FUNCTION autoinc () - RETURNS trigger - AS '/Users/masonsharp/dev/pgxc/postgres-xc/inst/lib/autoinc.so' - LANGUAGE C; -CREATE FUNCTION funny_dup17 () - RETURNS trigger - AS '/Users/masonsharp/dev/pgxc/postgres-xc/inst/lib/regress.so' - LANGUAGE C; -CREATE FUNCTION ttdummy () - RETURNS trigger - AS '/Users/masonsharp/dev/pgxc/postgres-xc/inst/lib/regress.so' - LANGUAGE C; -CREATE FUNCTION set_ttdummy (int4) - RETURNS int4 - AS '/Users/masonsharp/dev/pgxc/postgres-xc/inst/lib/regress.so' - LANGUAGE C STRICT; --- Things that shouldn't work: -CREATE FUNCTION test1 (int) RETURNS int LANGUAGE SQL - AS 'SELECT ''not an integer'';'; -ERROR: return type mismatch in function declared to return integer -DETAIL: Actual return type is unknown. -CONTEXT: SQL function "test1" -CREATE FUNCTION test1 (int) RETURNS int LANGUAGE SQL - AS 'not even SQL'; -ERROR: syntax error at or near "not" -LINE 2: AS 'not even SQL'; - ^ -CREATE FUNCTION test1 (int) RETURNS int LANGUAGE SQL - AS 'SELECT 1, 2, 3;'; -ERROR: return type mismatch in function declared to return integer -DETAIL: Final statement must return exactly one column. -CONTEXT: SQL function "test1" -CREATE FUNCTION test1 (int) RETURNS int LANGUAGE SQL - AS 'SELECT $2;'; -ERROR: there is no parameter $2 -LINE 2: AS 'SELECT $2;'; - ^ -CREATE FUNCTION test1 (int) RETURNS int LANGUAGE SQL - AS 'a', 'b'; -ERROR: only one AS item needed for language "sql" -CREATE FUNCTION test1 (int) RETURNS int LANGUAGE C - AS 'nosuchfile'; -ERROR: could not access file "nosuchfile": No such file or directory -CREATE FUNCTION test1 (int) RETURNS int LANGUAGE C - AS '/Users/masonsharp/dev/pgxc/postgres-xc/inst/lib/regress.so', 'nosuchsymbol'; -ERROR: could not find function "nosuchsymbol" in file "/Users/masonsharp/dev/pgxc/postgres-xc/inst/lib/regress.so" -CREATE FUNCTION test1 (int) RETURNS int LANGUAGE internal - AS 'nosuch'; -ERROR: there is no built-in function named "nosuch" diff --git a/src/test/regress/expected/create_function_2.out b/src/test/regress/expected/create_function_2.out deleted file mode 100644 index a9031f1..0000000 --- a/src/test/regress/expected/create_function_2.out +++ /dev/null @@ -1,57 +0,0 @@ --- --- CREATE_FUNCTION_2 --- -CREATE FUNCTION hobbies(person) - RETURNS setof hobbies_r - AS 'select * from hobbies_r where person = $1.name' - LANGUAGE SQL; -CREATE FUNCTION hobby_construct(text, text) - RETURNS hobbies_r - AS 'select $1 as name, $2 as hobby' - LANGUAGE SQL; -CREATE FUNCTION hobbies_by_name(hobbies_r.name%TYPE) - RETURNS hobbies_r.person%TYPE - AS 'select person from hobbies_r where name = $1' - LANGUAGE SQL; -NOTICE: type reference hobbies_r.name%TYPE converted to text -NOTICE: type reference hobbies_r.person%TYPE converted to text -CREATE FUNCTION equipment(hobbies_r) - RETURNS setof equipment_r - AS 'select * from equipment_r where hobby = $1.name' - LANGUAGE SQL; -CREATE FUNCTION user_relns() - RETURNS setof name - AS 'select relname - from pg_class c, pg_namespace n - where relnamespace = n.oid and - (nspname !~ ''pg_.*'' and nspname <> ''information_schema'') and - relkind <> ''i'' ' - LANGUAGE SQL; -CREATE FUNCTION pt_in_widget(point, widget) - RETURNS bool - AS '/Users/masonsharp/dev/pgxc/postgres-xc/inst/lib/regress.so' - LANGUAGE C; -CREATE FUNCTION overpaid(emp) - RETURNS bool - AS '/Users/masonsharp/dev/pgxc/postgres-xc/inst/lib/regress.so' - LANGUAGE C; -CREATE FUNCTION boxarea(box) - RETURNS float8 - AS '/Users/masonsharp/dev/pgxc/postgres-xc/inst/lib/regress.so' - LANGUAGE C; -CREATE FUNCTION interpt_pp(path, path) - RETURNS point - AS '/Users/masonsharp/dev/pgxc/postgres-xc/inst/lib/regress.so' - LANGUAGE C; -CREATE FUNCTION reverse_name(name) - RETURNS name - AS '/Users/masonsharp/dev/pgxc/postgres-xc/inst/lib/regress.so' - LANGUAGE C; -CREATE FUNCTION oldstyle_length(int4, text) - RETURNS int4 - AS '/Users/masonsharp/dev/pgxc/postgres-xc/inst/lib/regress.so' - LANGUAGE C; --- --- Function dynamic loading --- -LOAD '/Users/masonsharp/dev/pgxc/postgres-xc/inst/lib/regress.so'; diff --git a/src/test/regress/expected/largeobject.out b/src/test/regress/expected/largeobject.out deleted file mode 100644 index e71b608..0000000 --- a/src/test/regress/expected/largeobject.out +++ /dev/null @@ -1,284 +0,0 @@ --- --- Test large object support --- --- Load a file -CREATE TABLE lotest_stash_values (loid oid, fd integer); --- lo_creat(mode integer) returns oid --- The mode arg to lo_creat is unused, some vestigal holdover from ancient times --- returns the large object id -INSERT INTO lotest_stash_values (loid) SELECT lo_creat(42); --- NOTE: large objects require transactions -BEGIN; --- lo_open(lobjId oid, mode integer) returns integer --- The mode parameter to lo_open uses two constants: --- INV_READ = 0x20000 --- INV_WRITE = 0x40000 --- The return value is a file descriptor-like value which remains valid for the --- transaction. -UPDATE lotest_stash_values SET fd = lo_open(loid, CAST(x'20000' | x'40000' AS integer)); --- loread/lowrite names are wonky, different from other functions which are lo_* --- lowrite(fd integer, data bytea) returns integer --- the integer is the number of bytes written -SELECT lowrite(fd, ' -Whose woods these are I think I know, -His house is in the village though. -He will not see me stopping here, -To watch his woods fill up with snow. - -My little horse must think it queer, -To stop without a farmhouse near, -Between the woods and frozen lake, -The darkest evening of the year. - -He gives his harness bells a shake, -To ask if there is some mistake. -The only other sound''s the sweep, -Of easy wind and downy flake. - -The woods are lovely, dark and deep, -But I have promises to keep, -And miles to go before I sleep, -And miles to go before I sleep. - - -- Robert Frost -') FROM lotest_stash_values; - lowrite ---------- - 578 -(1 row) - --- lo_close(fd integer) returns integer --- return value is 0 for success, or <0 for error (actually only -1, but...) -SELECT lo_close(fd) FROM lotest_stash_values; - lo_close ----------- - 0 -(1 row) - -END; --- Read out a portion -BEGIN; -UPDATE lotest_stash_values SET fd=lo_open(loid, CAST(x'20000' | x'40000' AS integer)); --- lo_lseek(fd integer, offset integer, whence integer) returns integer --- offset is in bytes, whence is one of three values: --- SEEK_SET (= 0) meaning relative to beginning --- SEEK_CUR (= 1) meaning relative to current position --- SEEK_END (= 2) meaning relative to end (offset better be negative) --- returns current position in file -SELECT lo_lseek(fd, 422, 0) FROM lotest_stash_values; - lo_lseek ----------- - 422 -(1 row) - --- loread/lowrite names are wonky, different from other functions which are lo_* --- loread(fd integer, len integer) returns bytea -SELECT loread(fd, 35) FROM lotest_stash_values; - loread -------------------------------------- - The woods are lovely, dark and deep -(1 row) - -SELECT lo_lseek(fd, -19, 1) FROM lotest_stash_values; - lo_lseek ----------- - 438 -(1 row) - -SELECT lowrite(fd, 'n') FROM lotest_stash_values; - lowrite ---------- - 1 -(1 row) - -SELECT lo_tell(fd) FROM lotest_stash_values; - lo_tell ---------- - 439 -(1 row) - -SELECT lo_lseek(fd, -156, 2) FROM lotest_stash_values; - lo_lseek ----------- - 422 -(1 row) - -SELECT loread(fd, 35) FROM lotest_stash_values; - loread -------------------------------------- - The woods are lonely, dark and deep -(1 row) - -SELECT lo_close(fd) FROM lotest_stash_values; - lo_close ----------- - 0 -(1 row) - -END; --- Test resource management -BEGIN; -SELECT lo_open(loid, x'40000'::int) from lotest_stash_values; - lo_open ---------- - 0 -(1 row) - -ABORT; --- Test truncation. -BEGIN; -UPDATE lotest_stash_values SET fd=lo_open(loid, CAST(x'20000' | x'40000' AS integer)); -SELECT lo_truncate(fd, 10) FROM lotest_stash_values; - lo_truncate -------------- - 0 -(1 row) - -SELECT loread(fd, 15) FROM lotest_stash_values; - loread ---------------- - \012Whose woo -(1 row) - -SELECT lo_truncate(fd, 10000) FROM lotest_stash_values; - lo_truncate -------------- - 0 -(1 row) - -SELECT loread(fd, 10) FROM lotest_stash_values; - loread ------------------------------------------- - \000\000\000\000\000\000\000\000\000\000 -(1 row) - -SELECT lo_lseek(fd, 0, 2) FROM lotest_stash_values; - lo_lseek ----------- - 10000 -(1 row) - -SELECT lo_tell(fd) FROM lotest_stash_values; - lo_tell ---------- - 10000 -(1 row) - -SELECT lo_truncate(fd, 5000) FROM lotest_stash_values; - lo_truncate -------------- - 0 -(1 row) - -SELECT lo_lseek(fd, 0, 2) FROM lotest_stash_values; - lo_lseek ----------- - 5000 -(1 row) - -SELECT lo_tell(fd) FROM lotest_stash_values; - lo_tell ---------- - 5000 -(1 row) - -SELECT lo_close(fd) FROM lotest_stash_values; - lo_close ----------- - 0 -(1 row) - -END; --- lo_unlink(lobjId oid) returns integer --- return value appears to always be 1 -SELECT lo_unlink(loid) from lotest_stash_values; - lo_unlink ------------ - 1 -(1 row) - -TRUNCATE lotest_stash_values; -INSERT INTO lotest_stash_values (loid) SELECT lo_import('/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/data/tenk.data'); -BEGIN; -UPDATE lotest_stash_values SET fd=lo_open(loid, CAST(x'20000' | x'40000' AS integer)); --- with the default BLKSZ, LOBLKSZ = 2048, so this positions us for a block --- edge case -SELECT lo_lseek(fd, 2030, 0) FROM lotest_stash_values; - lo_lseek ----------- - 2030 -(1 row) - --- this should get half of the value from page 0 and half from page 1 of the --- large object -SELECT loread(fd, 36) FROM lotest_stash_values; - loread ------------------------------------------------------------------ - AAA\011FBAAAA\011VVVVxx\0122513\01132\0111\0111\0113\01113\0111 -(1 row) - -SELECT lo_tell(fd) FROM lotest_stash_values; - lo_tell ---------- - 2066 -(1 row) - -SELECT lo_lseek(fd, -26, 1) FROM lotest_stash_values; - lo_lseek ----------- - 2040 -(1 row) - -SELECT lowrite(fd, 'abcdefghijklmnop') FROM lotest_stash_values; - lowrite ---------- - 16 -(1 row) - -SELECT lo_lseek(fd, 2030, 0) FROM lotest_stash_values; - lo_lseek ----------- - 2030 -(1 row) - -SELECT loread(fd, 36) FROM lotest_stash_values; - loread ------------------------------------------------------ - AAA\011FBAAAAabcdefghijklmnop1\0111\0113\01113\0111 -(1 row) - -SELECT lo_close(fd) FROM lotest_stash_values; - lo_close ----------- - 0 -(1 row) - -END; -SELECT lo_export(loid, '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/results/lotest.txt') FROM lotest_stash_values; - lo_export ------------ - 1 -(1 row) - -\lo_import 'results/lotest.txt' -\set newloid :LASTOID --- just make sure \lo_export does not barf -\lo_export :newloid 'results/lotest2.txt' --- This is a hack to test that export/import are reversible --- This uses knowledge about the inner workings of large object mechanism --- which should not be used outside it. This makes it a HACK -SELECT pageno, data FROM pg_largeobject WHERE loid = (SELECT loid from lotest_stash_values) -EXCEPT -SELECT pageno, data FROM pg_largeobject WHERE loid = :newloid; - pageno | data ---------+------ -(0 rows) - -SELECT lo_unlink(loid) FROM lotest_stash_values; - lo_unlink ------------ - 1 -(1 row) - -\lo_unlink :newloid -TRUNCATE lotest_stash_values; diff --git a/src/test/regress/expected/largeobject_1.out b/src/test/regress/expected/largeobject_1.out deleted file mode 100644 index 5fe7cae..0000000 --- a/src/test/regress/expected/largeobject_1.out +++ /dev/null @@ -1,284 +0,0 @@ --- --- Test large object support --- --- Load a file -CREATE TABLE lotest_stash_values (loid oid, fd integer); --- lo_creat(mode integer) returns oid --- The mode arg to lo_creat is unused, some vestigal holdover from ancient times --- returns the large object id -INSERT INTO lotest_stash_values (loid) SELECT lo_creat(42); --- NOTE: large objects require transactions -BEGIN; --- lo_open(lobjId oid, mode integer) returns integer --- The mode parameter to lo_open uses two constants: --- INV_READ = 0x20000 --- INV_WRITE = 0x40000 --- The return value is a file descriptor-like value which remains valid for the --- transaction. -UPDATE lotest_stash_values SET fd = lo_open(loid, CAST(x'20000' | x'40000' AS integer)); --- loread/lowrite names are wonky, different from other functions which are lo_* --- lowrite(fd integer, data bytea) returns integer --- the integer is the number of bytes written -SELECT lowrite(fd, ' -Whose woods these are I think I know, -His house is in the village though. -He will not see me stopping here, -To watch his woods fill up with snow. - -My little horse must think it queer, -To stop without a farmhouse near, -Between the woods and frozen lake, -The darkest evening of the year. - -He gives his harness bells a shake, -To ask if there is some mistake. -The only other sound''s the sweep, -Of easy wind and downy flake. - -The woods are lovely, dark and deep, -But I have promises to keep, -And miles to go before I sleep, -And miles to go before I sleep. - - -- Robert Frost -') FROM lotest_stash_values; - lowrite ---------- - 578 -(1 row) - --- lo_close(fd integer) returns integer --- return value is 0 for success, or <0 for error (actually only -1, but...) -SELECT lo_close(fd) FROM lotest_stash_values; - lo_close ----------- - 0 -(1 row) - -END; --- Read out a portion -BEGIN; -UPDATE lotest_stash_values SET fd=lo_open(loid, CAST(x'20000' | x'40000' AS integer)); --- lo_lseek(fd integer, offset integer, whence integer) returns integer --- offset is in bytes, whence is one of three values: --- SEEK_SET (= 0) meaning relative to beginning --- SEEK_CUR (= 1) meaning relative to current position --- SEEK_END (= 2) meaning relative to end (offset better be negative) --- returns current position in file -SELECT lo_lseek(fd, 422, 0) FROM lotest_stash_values; - lo_lseek ----------- - 422 -(1 row) - --- loread/lowrite names are wonky, different from other functions which are lo_* --- loread(fd integer, len integer) returns bytea -SELECT loread(fd, 35) FROM lotest_stash_values; - loread -------------------------------------- - The woods are lovely, dark and deep -(1 row) - -SELECT lo_lseek(fd, -19, 1) FROM lotest_stash_values; - lo_lseek ----------- - 438 -(1 row) - -SELECT lowrite(fd, 'n') FROM lotest_stash_values; - lowrite ---------- - 1 -(1 row) - -SELECT lo_tell(fd) FROM lotest_stash_values; - lo_tell ---------- - 439 -(1 row) - -SELECT lo_lseek(fd, -156, 2) FROM lotest_stash_values; - lo_lseek ----------- - 422 -(1 row) - -SELECT loread(fd, 35) FROM lotest_stash_values; - loread -------------------------------------- - The woods are lonely, dark and deep -(1 row) - -SELECT lo_close(fd) FROM lotest_stash_values; - lo_close ----------- - 0 -(1 row) - -END; --- Test resource management -BEGIN; -SELECT lo_open(loid, x'40000'::int) from lotest_stash_values; - lo_open ---------- - 0 -(1 row) - -ABORT; --- Test truncation. -BEGIN; -UPDATE lotest_stash_values SET fd=lo_open(loid, CAST(x'20000' | x'40000' AS integer)); -SELECT lo_truncate(fd, 10) FROM lotest_stash_values; - lo_truncate -------------- - 0 -(1 row) - -SELECT loread(fd, 15) FROM lotest_stash_values; - loread ---------------- - \012Whose woo -(1 row) - -SELECT lo_truncate(fd, 10000) FROM lotest_stash_values; - lo_truncate -------------- - 0 -(1 row) - -SELECT loread(fd, 10) FROM lotest_stash_values; - loread ------------------------------------------- - \000\000\000\000\000\000\000\000\000\000 -(1 row) - -SELECT lo_lseek(fd, 0, 2) FROM lotest_stash_values; - lo_lseek ----------- - 10000 -(1 row) - -SELECT lo_tell(fd) FROM lotest_stash_values; - lo_tell ---------- - 10000 -(1 row) - -SELECT lo_truncate(fd, 5000) FROM lotest_stash_values; - lo_truncate -------------- - 0 -(1 row) - -SELECT lo_lseek(fd, 0, 2) FROM lotest_stash_values; - lo_lseek ----------- - 5000 -(1 row) - -SELECT lo_tell(fd) FROM lotest_stash_values; - lo_tell ---------- - 5000 -(1 row) - -SELECT lo_close(fd) FROM lotest_stash_values; - lo_close ----------- - 0 -(1 row) - -END; --- lo_unlink(lobjId oid) returns integer --- return value appears to always be 1 -SELECT lo_unlink(loid) from lotest_stash_values; - lo_unlink ------------ - 1 -(1 row) - -TRUNCATE lotest_stash_values; -INSERT INTO lotest_stash_values (loid) SELECT lo_import('/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/data/tenk.data'); -BEGIN; -UPDATE lotest_stash_values SET fd=lo_open(loid, CAST(x'20000' | x'40000' AS integer)); --- with the default BLKSZ, LOBLKSZ = 2048, so this positions us for a block --- edge case -SELECT lo_lseek(fd, 2030, 0) FROM lotest_stash_values; - lo_lseek ----------- - 2030 -(1 row) - --- this should get half of the value from page 0 and half from page 1 of the --- large object -SELECT loread(fd, 36) FROM lotest_stash_values; - loread --------------------------------------------------------------- - 44\011144\0111144\0114144\0119144\01188\01189\011SNAAAA\011F -(1 row) - -SELECT lo_tell(fd) FROM lotest_stash_values; - lo_tell ---------- - 2066 -(1 row) - -SELECT lo_lseek(fd, -26, 1) FROM lotest_stash_values; - lo_lseek ----------- - 2040 -(1 row) - -SELECT lowrite(fd, 'abcdefghijklmnop') FROM lotest_stash_values; - lowrite ---------- - 16 -(1 row) - -SELECT lo_lseek(fd, 2030, 0) FROM lotest_stash_values; - lo_lseek ----------- - 2030 -(1 row) - -SELECT loread(fd, 36) FROM lotest_stash_values; - loread --------------------------------------------------- - 44\011144\011114abcdefghijklmnop9\011SNAAAA\011F -(1 row) - -SELECT lo_close(fd) FROM lotest_stash_values; - lo_close ----------- - 0 -(1 row) - -END; -SELECT lo_export(loid, '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/results/lotest.txt') FROM lotest_stash_values; - lo_export ------------ - 1 -(1 row) - -\lo_import 'results/lotest.txt' -\set newloid :LASTOID --- just make sure \lo_export does not barf -\lo_export :newloid 'results/lotest2.txt' --- This is a hack to test that export/import are reversible --- This uses knowledge about the inner workings of large object mechanism --- which should not be used outside it. This makes it a HACK -SELECT pageno, data FROM pg_largeobject WHERE loid = (SELECT loid from lotest_stash_values) -EXCEPT -SELECT pageno, data FROM pg_largeobject WHERE loid = :newloid; - pageno | data ---------+------ -(0 rows) - -SELECT lo_unlink(loid) FROM lotest_stash_values; - lo_unlink ------------ - 1 -(1 row) - -\lo_unlink :newloid -TRUNCATE lotest_stash_values; diff --git a/src/test/regress/expected/misc.out b/src/test/regress/expected/misc.out deleted file mode 100644 index 5a53260..0000000 --- a/src/test/regress/expected/misc.out +++ /dev/null @@ -1,761 +0,0 @@ --- --- MISC --- --- --- BTREE --- -UPDATE onek - SET unique1 = onek.unique1 + 1; -UPDATE onek - SET unique1 = onek.unique1 - 1; --- --- BTREE partial --- --- UPDATE onek2 --- SET unique1 = onek2.unique1 + 1; ---UPDATE onek2 --- SET unique1 = onek2.unique1 - 1; --- --- BTREE shutting out non-functional updates --- --- the following two tests seem to take a long time on some --- systems. This non-func update stuff needs to be examined --- more closely. - jolly (2/22/96) --- -UPDATE tmp - SET stringu1 = reverse_name(onek.stringu1) - FROM onek - WHERE onek.stringu1 = 'JBAAAA' and - onek.stringu1 = tmp.stringu1; -UPDATE tmp - SET stringu1 = reverse_name(onek2.stringu1) - FROM onek2 - WHERE onek2.stringu1 = 'JCAAAA' and - onek2.stringu1 = tmp.stringu1; -DROP TABLE tmp; ---UPDATE person* --- SET age = age + 1; ---UPDATE person* --- SET age = age + 3 --- WHERE name = 'linda'; --- --- copy --- -COPY onek TO '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/results/onek.data'; -DELETE FROM onek; -COPY onek FROM '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/results/onek.data'; -SELECT unique1 FROM onek WHERE unique1 < 2 ORDER BY unique1; - unique1 ---------- - 0 - 1 -(2 rows) - -DELETE FROM onek2; -COPY onek2 FROM '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/results/onek.data'; -SELECT unique1 FROM onek2 WHERE unique1 < 2 ORDER BY unique1; - unique1 ---------- - 0 - 1 -(2 rows) - -COPY BINARY stud_emp TO '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/results/stud_emp.data'; -DELETE FROM stud_emp; -COPY BINARY stud_emp FROM '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/results/stud_emp.data'; -SELECT * FROM stud_emp ORDER BY 1, 2; - name | age | location | salary | manager | gpa | percent --------+-----+------------+--------+---------+-----+--------- - cim | 30 | (10.5,4.7) | 400 | | 3.4 | - jeff | 23 | (8,7.7) | 600 | sharon | 3.5 | - linda | 19 | (0.9,6.1) | 100 | | 2.9 | -(3 rows) - --- COPY aggtest FROM stdin; --- 56 7.8 --- 100 99.097 --- 0 0.09561 --- 42 324.78 --- . --- COPY aggtest TO stdout; --- --- inheritance stress test --- -SELECT * FROM a_star* ORDER BY 1,2; - class | a --------+---- - a | 1 - a | 2 - a | - b | 3 - b | 4 - b | - b | - c | 5 - c | 6 - c | - c | - d | 7 - d | 8 - d | 9 - d | 10 - d | 11 - d | 12 - d | 13 - d | 14 - d | - d | - d | - d | - d | - d | - d | - d | - e | 15 - e | 16 - e | 17 - e | 18 - e | - e | - e | - f | 19 - f | 20 - f | 21 - f | 22 - f | 24 - f | 25 - f | 26 - f | 27 - f | - f | - f | - f | - f | - f | - f | - f | -(50 rows) - -SELECT * - FROM b_star* x - WHERE x.b = text 'bumble' or x.a < 3; - class | a | b --------+---+-------- - b | | bumble -(1 row) - -SELECT class, a - FROM c_star* x - WHERE x.c ~ text 'hi' ORDER BY 1,2; - class | a --------+---- - c | 5 - c | - d | 7 - d | 8 - d | 10 - d | 12 - d | - d | - d | - d | - e | 15 - e | 16 - e | - e | - f | 19 - f | 20 - f | 21 - f | 24 - f | - f | - f | - f | -(22 rows) - -SELECT class, b, c - FROM d_star* x - WHERE x.a < 100 ORDER BY 1,2,3; - class | b | c --------+---------+------------ - d | fumble | - d | grumble | hi sunita - d | rumble | - d | stumble | hi koko - d | | hi avi - d | | hi kristin - d | | - d | | -(8 rows) - -SELECT class, c FROM e_star* x WHERE x.c NOTNULL ORDER BY 1,2; - class | c --------+------------- - e | hi bob - e | hi carol - e | hi elisa - e | hi michelle - f | hi allison - f | hi carl - f | hi claire - f | hi jeff - f | hi keith - f | hi marc - f | hi marcel - f | hi mike -(12 rows) - -SELECT * FROM f_star* x WHERE x.c ISNULL ORDER BY 1,2; - class | a | c | e | f --------+----+---+-----+------------------------------------------- - f | 22 | | -7 | ((111,555),(222,666),(333,777),(444,888)) - f | 25 | | -9 | - f | 26 | | | ((11111,33333),(22222,44444)) - f | 27 | | | - f | | | -11 | ((1111111,3333333),(2222222,4444444)) - f | | | -12 | - f | | | | ((11111111,33333333),(22222222,44444444)) - f | | | | -(8 rows) - --- grouping and aggregation on inherited sets have been busted in the past... -SELECT sum(a) FROM a_star*; - sum ------ - 355 -(1 row) - -SELECT class, sum(a) FROM a_star* GROUP BY class ORDER BY class; - class | sum --------+----- - a | 3 - b | 7 - c | 11 - d | 84 - e | 66 - f | 184 -(6 rows) - -ALTER TABLE f_star RENAME COLUMN f TO ff; -ALTER TABLE e_star* RENAME COLUMN e TO ee; -ALTER TABLE d_star* RENAME COLUMN d TO dd; -ALTER TABLE c_star* RENAME COLUMN c TO cc; -ALTER TABLE b_star* RENAME COLUMN b TO bb; -ALTER TABLE a_star* RENAME COLUMN a TO aa; -SELECT class, aa - FROM a_star* x - WHERE aa ISNULL ORDER BY 1,2; - class | aa --------+---- - a | - b | - b | - c | - c | - d | - d | - d | - d | - d | - d | - d | - d | - e | - e | - e | - f | - f | - f | - f | - f | - f | - f | - f | -(24 rows) - --- As of Postgres 7.1, ALTER implicitly recurses, --- so this should be same as ALTER a_star* -ALTER TABLE a_star RENAME COLUMN aa TO foo; -SELECT class, foo - FROM a_star* x - WHERE x.foo >= 2 ORDER BY 1,2; - class | foo --------+----- - a | 2 - b | 3 - b | 4 - c | 5 - c | 6 - d | 7 - d | 8 - d | 9 - d | 10 - d | 11 - d | 12 - d | 13 - d | 14 - e | 15 - e | 16 - e | 17 - e | 18 - f | 19 - f | 20 - f | 21 - f | 22 - f | 24 - f | 25 - f | 26 - f | 27 -(25 rows) - -ALTER TABLE a_star RENAME COLUMN foo TO aa; -SELECT * - from a_star* - WHERE aa < 1000 ORDER BY 1,2; - class | aa --------+---- - a | 1 - a | 2 - b | 3 - b | 4 - c | 5 - c | 6 - d | 7 - d | 8 - d | 9 - d | 10 - d | 11 - d | 12 - d | 13 - d | 14 - e | 15 - e | 16 - e | 17 - e | 18 - f | 19 - f | 20 - f | 21 - f | 22 - f | 24 - f | 25 - f | 26 - f | 27 -(26 rows) - -ALTER TABLE f_star ADD COLUMN f int4; -UPDATE f_star SET f = 10; -ALTER TABLE e_star* ADD COLUMN e int4; ---UPDATE e_star* SET e = 42; -SELECT * FROM e_star* ORDER BY 1,2; - class | aa | cc | ee | e --------+----+-------------+-----+--- - e | 15 | hi carol | -1 | - e | 16 | hi bob | | - e | 17 | | -2 | - e | 18 | | | - e | | hi elisa | | - e | | | -4 | - e | | hi michelle | -3 | - f | 19 | hi claire | -5 | - f | 20 | hi mike | -6 | - f | 21 | hi marcel | | - f | 22 | | -7 | - f | 24 | hi marc | | - f | 25 | | -9 | - f | 26 | | | - f | 27 | | | - f | | | | - f | | hi keith | -8 | - f | | hi allison | -10 | - f | | hi jeff | | - f | | | -11 | - f | | hi carl | | - f | | | -12 | - f | | | | -(23 rows) - -ALTER TABLE a_star* ADD COLUMN a text; -NOTICE: merging definition of column "a" for child "d_star" ---UPDATE b_star* --- SET a = text 'gazpacho' --- WHERE aa > 4; -SELECT class, aa, a FROM a_star* ORDER BY 1,2; - class | aa | a --------+----+--- - a | 1 | - a | 2 | - a | | - b | 3 | - b | 4 | - b | | - b | | - c | 5 | - c | 6 | - c | | - c | | - d | 7 | - d | 8 | - d | 9 | - d | 10 | - d | 11 | - d | 12 | - d | 13 | - d | 14 | - d | | - d | | - d | | - d | | - d | | - d | | - d | | - d | | - e | 15 | - e | 16 | - e | 17 | - e | 18 | - e | | - e | | - e | | - f | 19 | - f | 20 | - f | 21 | - f | 22 | - f | 24 | - f | 25 | - f | 26 | - f | 27 | - f | | - f | | - f | | - f | | - f | | - f | | - f | | - f | | -(50 rows) - --- --- versions --- --- --- postquel functions --- --- --- mike does post_hacking, --- joe and sally play basketball, and --- everyone else does nothing. --- -SELECT p.name, name(p.hobbies) FROM ONLY person p ORDER BY 1,2; - name | name --------+------------- - joe | basketball - mike | posthacking - sally | basketball -(3 rows) - --- --- as above, but jeff also does post_hacking. --- -SELECT p.name, name(p.hobbies) FROM person* p ORDER BY 1,2; - name | name --------+------------- - jeff | posthacking - joe | basketball - mike | posthacking - sally | basketball -(4 rows) - --- --- the next two queries demonstrate how functions generate bogus duplicates. --- this is a "feature" .. --- -SELECT DISTINCT hobbies_r.name, name(hobbies_r.equipment) FROM hobbies_r - ORDER BY 1,2; - name | name --------------+--------------- - basketball | hightops - posthacking | advil - posthacking | peet's coffee - skywalking | guts -(4 rows) - -SELECT hobbies_r.name, (hobbies_r.equipment).name FROM hobbies_r ORDER BY 1,2; - name | name --------------+--------------- - basketball | hightops - basketball | hightops - posthacking | advil - posthacking | advil - posthacking | peet's coffee - posthacking | peet's coffee - skywalking | guts -(7 rows) - --- --- mike needs advil and peet's coffee, --- joe and sally need hightops, and --- everyone else is fine. --- -SELECT p.name, name(p.hobbies), name(equipment(p.hobbies)) FROM ONLY person p ORDER BY 1,2,3; - name | name | name --------+-------------+--------------- - joe | basketball | hightops - mike | posthacking | advil - mike | posthacking | peet's coffee - sally | basketball | hightops -(4 rows) - --- --- as above, but jeff needs advil and peet's coffee as well. --- -SELECT p.name, name(p.hobbies), name(equipment(p.hobbies)) FROM person* p ORDER BY 1,2,3; - name | name | name --------+-------------+--------------- - jeff | posthacking | advil - jeff | posthacking | peet's coffee - joe | basketball | hightops - mike | posthacking | advil - mike | posthacking | peet's coffee - sally | basketball | hightops -(6 rows) - --- --- just like the last two, but make sure that the target list fixup and --- unflattening is being done correctly. --- -SELECT name(equipment(p.hobbies)), p.name, name(p.hobbies) FROM ONLY person p ORDER BY 1,2,3; - name | name | name ----------------+-------+------------- - advil | mike | posthacking - hightops | joe | basketball - hightops | sally | basketball - peet's coffee | mike | posthacking -(4 rows) - -SELECT (p.hobbies).equipment.name, p.name, name(p.hobbies) FROM person* p ORDER BY 1,2,3; - name | name | name ----------------+-------+------------- - advil | jeff | posthacking - advil | mike | posthacking - hightops | joe | basketball - hightops | sally | basketball - peet's coffee | jeff | posthacking - peet's coffee | mike | posthacking -(6 rows) - -SELECT (p.hobbies).equipment.name, name(p.hobbies), p.name FROM ONLY person p ORDER BY 1,2,3; - name | name | name ----------------+-------------+------- - advil | posthacking | mike - hightops | basketball | joe - hightops | basketball | sally - peet's coffee | posthacking | mike -(4 rows) - -SELECT name(equipment(p.hobbies)), name(p.hobbies), p.name FROM person* p ORDER BY 1,2,3; - name | name | name ----------------+-------------+------- - advil | posthacking | jeff - advil | posthacking | mike - hightops | basketball | joe - hightops | basketball | sally - peet's coffee | posthacking | jeff - peet's coffee | posthacking | mike -(6 rows) - -SELECT user_relns() AS user_relns - ORDER BY user_relns; - user_relns ---------------------- - a - a_star - abstime_tbl - aggtest - array_index_op_test - array_op_test - arrtest - b - b_star - box_tbl - bprime - bt_f8_heap - bt_i4_heap - bt_name_heap - bt_txt_heap - c - c_star - char_tbl - check2_tbl - check_seq - check_tbl - circle_tbl - city - copy_tbl - d - d_star - date_tbl - default_seq - default_tbl - defaultexpr_tbl - dept - e_star - emp - equipment_r - f_star - fast_emp4000 - float4_tbl - float8_tbl - func_index_heap - hash_f8_heap - hash_i4_heap - hash_name_heap - hash_txt_heap - hobbies_r - iexit - ihighway - inet_tbl - inhe - inhf - inhx - insert_seq - insert_tbl - int2_tbl - int4_tbl - int8_tbl - interval_tbl - iportaltest - log_table - lseg_tbl - main_table - money_data - num_data - num_exp_add - num_exp_div - num_exp_ln - num_exp_log10 - num_exp_mul - num_exp_power_10_ln - num_exp_sqrt - num_exp_sub - num_input_test - num_result - onek - onek2 - path_tbl - person - point_tbl - polygon_tbl - ramp - random_tbl - real_city - reltime_tbl - road - shighway - slow_emp4000 - street - stud_emp - student - subselect_tbl - tenk1 - tenk2 - test_tsvector - text_tbl - time_tbl - timestamp_tbl - timestamptz_tbl - timetz_tbl - tinterval_tbl - toyemp - varchar_tbl - xacttest -(101 rows) - -SELECT name(equipment(hobby_construct(text 'skywalking', text 'mer'))); - name ------- - guts -(1 row) - -SELECT hobbies_by_name('basketball'); - hobbies_by_name ------------------ - joe -(1 row) - -SELECT name, overpaid(emp.*) FROM emp ORDER BY 1,2; - name | overpaid ---------+---------- - bill | t - cim | f - jeff | f - linda | f - sam | t - sharon | t -(6 rows) - --- --- Try a few cases with SQL-spec row constructor expressions --- -SELECT * FROM equipment(ROW('skywalking', 'mer')); - name | hobby -------+------------ - guts | skywalking -(1 row) - -SELECT name(equipment(ROW('skywalking', 'mer'))); - name ------- - guts -(1 row) - -SELECT *, name(equipment(h.*)) FROM hobbies_r h ORDER BY 1,2,3; - name | person | name --------------+--------+--------------- - basketball | joe | hightops - basketball | sally | hightops - posthacking | jeff | advil - posthacking | jeff | peet's coffee - posthacking | mike | advil - posthacking | mike | peet's coffee - skywalking | | guts -(7 rows) - -SELECT *, (equipment(CAST((h.*) AS hobbies_r))).name FROM hobbies_r h ORDER BY 1,2,3; - name | person | name --------------+--------+--------------- - basketball | joe | hightops - basketball | sally | hightops - posthacking | jeff | advil - posthacking | jeff | peet's coffee - posthacking | mike | advil - posthacking | mike | peet's coffee - skywalking | | guts -(7 rows) - --- --- check that old-style C functions work properly with TOASTed values --- -create table oldstyle_test(i int4, t text); -insert into oldstyle_test values(null,null); -insert into oldstyle_test values(0,'12'); -insert into oldstyle_test values(1000,'12'); -insert into oldstyle_test values(0, repeat('x', 50000)); -select i, length(t), octet_length(t), oldstyle_length(i,t) from oldstyle_test ORDER BY 1,2,3; - i | length | octet_length | oldstyle_length -------+--------+--------------+----------------- - 0 | 2 | 2 | 2 - 0 | 50000 | 50000 | 50000 - 1000 | 2 | 2 | 1002 - | | | -(4 rows) - -drop table oldstyle_test; --- --- functional joins --- --- --- instance rules --- --- --- rewrite rules --- diff --git a/src/test/regress/expected/tablespace.out b/src/test/regress/expected/tablespace.out deleted file mode 100644 index 4df5192..0000000 --- a/src/test/regress/expected/tablespace.out +++ /dev/null @@ -1,74 +0,0 @@ --- create a tablespace we can use -CREATE TABLESPACE testspace LOCATION '/Users/masonsharp/dev/pgxc/postgres-xc/src/test/regress/testtablespace'; --- create a schema we can use -CREATE SCHEMA testschema; --- try a table -CREATE TABLE testschema.foo (i int) TABLESPACE testspace; -SELECT relname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_class c - where c.reltablespace = t.oid AND c.relname = 'foo'; - relname | spcname ----------+----------- - foo | testspace -(1 row) - -INSERT INTO testschema.foo VALUES(1); -INSERT INTO testschema.foo VALUES(2); --- tables from dynamic sources -CREATE TABLE testschema.asselect TABLESPACE testspace AS SELECT 1; -SELECT relname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_class c - where c.reltablespace = t.oid AND c.relname = 'asselect'; - relname | spcname -----------+----------- - asselect | testspace -(1 row) - -PREPARE selectsource(int) AS SELECT $1; -CREATE TABLE testschema.asexecute TABLESPACE testspace - AS EXECUTE selectsource(2); -SELECT relname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_class c - where c.reltablespace = t.oid AND c.relname = 'asexecute'; - relname | spcname ------------+----------- - asexecute | testspace -(1 row) - --- index -CREATE INDEX foo_idx on testschema.foo(i) TABLESPACE testspace; -SELECT relname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_class c - where c.reltablespace = t.oid AND c.relname = 'foo_idx'; - relname | spcname ----------+----------- - foo_idx | testspace -(1 row) - --- let's try moving a table from one place to another -CREATE TABLE testschema.atable AS VALUES (1), (2); -CREATE UNIQUE INDEX anindex ON testschema.atable(column1); -ALTER TABLE testschema.atable SET TABLESPACE testspace; -ALTER INDEX testschema.anindex SET TABLESPACE testspace; -INSERT INTO testschema.atable VALUES(3); -- ok -INSERT INTO testschema.atable VALUES(1); -- fail (checks index) -ERROR: duplicate key value violates unique constraint "anindex" -SELECT COUNT(*) FROM testschema.atable; -- checks heap - count -------- - 3 -(1 row) - --- Will fail with bad path -CREATE TABLESPACE badspace LOCATION '/no/such/location'; -ERROR: could not set permissions on directory "/no/such/location": No such file or directory --- No such tablespace -CREATE TABLE bar (i int) TABLESPACE nosuchspace; -ERROR: tablespace "nosuchspace" does not exist --- Fail, not empty -DROP TABLESPACE testspace; -ERROR: tablespace "testspace" is not empty -DROP SCHEMA testschema CASCADE; -NOTICE: drop cascades to 4 other objects -DETAIL: drop cascades to table testschema.foo -drop cascades to table testschema.asselect -drop cascades to table testschema.asexecute -drop cascades to table testschema.atable --- Should succeed -DROP TABLESPACE testspace; diff --git a/src/test/regress/sql/constraints.sql b/src/test/regress/sql/constraints.sql deleted file mode 100644 index 06528ec..0000000 --- a/src/test/regress/sql/constraints.sql +++ /dev/null @@ -1,261 +0,0 @@ --- --- CONSTRAINTS --- Constraints can be specified with: --- - DEFAULT clause --- - CHECK clauses --- - PRIMARY KEY clauses --- - UNIQUE clauses --- - --- --- DEFAULT syntax --- - -CREATE TABLE DEFAULT_TBL (i int DEFAULT 100, - x text DEFAULT 'vadim', f float8 DEFAULT 123.456); - -INSERT INTO DEFAULT_TBL VALUES (1, 'thomas', 57.0613); -INSERT INTO DEFAULT_TBL VALUES (1, 'bruce'); -INSERT INTO DEFAULT_TBL (i, f) VALUES (2, 987.654); -INSERT INTO DEFAULT_TBL (x) VALUES ('marc'); -INSERT INTO DEFAULT_TBL VALUES (3, null, 1.0); - -SELECT '' AS five, * FROM DEFAULT_TBL ORDER BY i,x,f; - -CREATE SEQUENCE DEFAULT_SEQ; - -CREATE TABLE DEFAULTEXPR_TBL (i1 int DEFAULT 100 + (200-199) * 2, - i2 int DEFAULT nextval('default_seq')); - -INSERT INTO DEFAULTEXPR_TBL VALUES (-1, -2); -INSERT INTO DEFAULTEXPR_TBL (i1) VALUES (-3); -INSERT INTO DEFAULTEXPR_TBL (i2) VALUES (-4); -INSERT INTO DEFAULTEXPR_TBL (i2) VALUES (NULL); - -SELECT '' AS four, * FROM DEFAULTEXPR_TBL ORDER BY i1,i2; - --- syntax errors --- test for extraneous comma -CREATE TABLE error_tbl (i int DEFAULT (100, )); --- this will fail because gram.y uses b_expr not a_expr for defaults, --- to avoid a shift/reduce conflict that arises from NOT NULL being --- part of the column definition syntax: -CREATE TABLE error_tbl (b1 bool DEFAULT 1 IN (1, 2)); --- this should work, however: -CREATE TABLE error_tbl (b1 bool DEFAULT (1 IN (1, 2))); - -DROP TABLE error_tbl; - --- --- CHECK syntax --- - -CREATE TABLE CHECK_TBL (x int, - CONSTRAINT CHECK_CON CHECK (x > 3)); - -INSERT INTO CHECK_TBL VALUES (5); -INSERT INT... [truncated message content] |
From: Michael P. <mic...@us...> - 2011-03-09 00:34:39
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via aadbdfe18024455d5e18cf9007de5b8a3f5135dc (commit) from f9690c125d5657cdf8b4c2d9e441d4fe62edf223 (commit) - Log ----------------------------------------------------------------- commit aadbdfe18024455d5e18cf9007de5b8a3f5135dc Author: Michael P <mic...@us...> Date: Wed Mar 9 09:32:28 2011 +0900 Fix when transforming a CREATE statement A RemoteQuery node was created even if Coordinator was not a remote one. diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c index 30f5cd9..5b6ba6b 100644 --- a/src/backend/parser/parse_utilcmd.c +++ b/src/backend/parser/parse_utilcmd.c @@ -278,7 +278,8 @@ transformCreateStmt(CreateStmt *stmt, const char *queryString) stmt->distributeby->disttype = DISTTYPE_HASH; stmt->distributeby->colname = cxt.fallback_dist_col; } - if (IS_PGXC_COORDINATOR) + /* Only a remote Coordinator is allowed to send a query to backend nodes */ + if (IS_PGXC_COORDINATOR && !IsConnFromCoord()) { RemoteQuery *step = makeNode(RemoteQuery); step->combine_type = COMBINE_TYPE_SAME; ----------------------------------------------------------------------- Summary of changes: src/backend/parser/parse_utilcmd.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) hooks/post-receive -- Postgres-XC |