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-10 17:23:59
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via 861f5131ddadd10fcd88f3653862601cddf0b255 (commit) from 0461384764ef25c8248e8d22ec09a23d3cd608a3 (commit) - Log ----------------------------------------------------------------- commit 861f5131ddadd10fcd88f3653862601cddf0b255 Author: Abbas <abb...@en...> Date: Thu Mar 10 22:22:53 2011 +0500 The test case portals finds a NULL connecction in ExecEndRemoteQuery and crashes the server. This patch puts a NULL check to avoid the crash diff --git a/src/backend/pgxc/pool/execRemote.c b/src/backend/pgxc/pool/execRemote.c index af2f80c..7f53a22 100644 --- a/src/backend/pgxc/pool/execRemote.c +++ b/src/backend/pgxc/pool/execRemote.c @@ -3801,6 +3801,13 @@ ExecEndRemoteQuery(RemoteQueryState *node) pfree(node->currentRow.msg); node->currentRow.msg = NULL; } + + if (conn == NULL) + { + node->conn_count--; + continue; + } + /* no data is expected */ if (conn->state == DN_CONNECTION_STATE_IDLE || conn->state == DN_CONNECTION_STATE_ERROR_FATAL) ----------------------------------------------------------------------- Summary of changes: src/backend/pgxc/pool/execRemote.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-03-10 09:22:55
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via 0461384764ef25c8248e8d22ec09a23d3cd608a3 (commit) from 95854dc24142a7ee751c05d658f52d84fc0649dc (commit) - Log ----------------------------------------------------------------- commit 0461384764ef25c8248e8d22ec09a23d3cd608a3 Author: Michael P <mic...@us...> Date: Thu Mar 10 18:19:26 2011 +0900 Fix for bug 3202643: Sequence error For the following sequence: create SEQUENCE seq; select nextval('seq'); select currval('seq'); select nextval('seq'); XC was returning 1 -> 100 -> 100 -> 101 PostgreSQL was returning 1 -> 100 -> 1 -> 100 This is corrected. We also check if nextval has been called once in a session when using currval. This is to correspond with PostgreSQL. diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c index ee19184..8a921f5 100644 --- a/src/backend/commands/sequence.c +++ b/src/backend/commands/sequence.c @@ -618,7 +618,13 @@ nextval_internal(Oid relid) /* Update the on-disk data */ seq->last_value = result; /* last fetched number */ seq->is_called = true; - } else + + /* save info in local cache */ + elm->last = result; /* last returned number */ + elm->cached = result; /* last fetched number */ + elm->last_valid = true; + } + else { #endif last = next = result = seq->last_value; @@ -798,21 +804,6 @@ currval_oid(PG_FUNCTION_ARGS) /* open and AccessShareLock sequence */ init_sequence(relid, &elm, &seqrel); -#ifdef PGXC - if (IS_PGXC_COORDINATOR) - { - char *seqname = GetGlobalSeqName(seqrel, NULL, NULL); - - result = (int64) GetCurrentValGTM(seqname); - if (result < 0) - ereport(ERROR, - (errcode(ERRCODE_CONNECTION_FAILURE), - errmsg("GTM error, could not obtain sequence value"))); - pfree(seqname); - } - else - { -#endif if (pg_class_aclcheck(elm->relid, GetUserId(), ACL_SELECT) != ACLCHECK_OK && pg_class_aclcheck(elm->relid, GetUserId(), ACL_USAGE) != ACLCHECK_OK) @@ -827,12 +818,21 @@ currval_oid(PG_FUNCTION_ARGS) errmsg("currval of sequence \"%s\" is not yet defined in this session", RelationGetRelationName(seqrel)))); - result = elm->last; - #ifdef PGXC + if (IS_PGXC_COORDINATOR) + { + char *seqname = GetGlobalSeqName(seqrel, NULL, NULL); + + result = (int64) GetCurrentValGTM(seqname); + if (result < 0) + ereport(ERROR, + (errcode(ERRCODE_CONNECTION_FAILURE), + errmsg("GTM error, could not obtain sequence value"))); + pfree(seqname); } +#else + result = elm->last; #endif - relation_close(seqrel, NoLock); PG_RETURN_INT64(result); diff --git a/src/gtm/main/gtm_seq.c b/src/gtm/main/gtm_seq.c index 9ea5672..8c15fe9 100644 --- a/src/gtm/main/gtm_seq.c +++ b/src/gtm/main/gtm_seq.c @@ -660,16 +660,8 @@ GTM_SeqGetCurrent(GTM_SequenceKey seqkey) GTM_RWLockAcquire(&seqinfo->gs_lock, GTM_LOCKMODE_WRITE); - /* - * If this is the first call to the sequence, set the value to the start - * value and mark the sequence as 'called' - */ - if (!SEQ_IS_CALLED(seqinfo)) - { - seqinfo->gs_value = seqinfo->gs_init_value; - seqinfo->gs_called = true; - } - value = seqinfo->gs_value; + value = seqinfo->gs_last_value; + GTM_RWLockRelease(&seqinfo->gs_lock); seq_release_seqinfo(seqinfo); return value; @@ -693,6 +685,8 @@ GTM_SeqSetVal(GTM_SequenceKey seqkey, GTM_Sequence nextval, bool iscalled) GTM_RWLockAcquire(&seqinfo->gs_lock, GTM_LOCKMODE_WRITE); + seqinfo->gs_last_value = seqinfo->gs_value; + if (seqinfo->gs_value != nextval) seqinfo->gs_value = nextval; @@ -734,7 +728,7 @@ GTM_SeqGetNext(GTM_SequenceKey seqkey) */ if (!SEQ_IS_CALLED(seqinfo)) { - value = seqinfo->gs_value = seqinfo->gs_init_value; + value = seqinfo->gs_last_value = seqinfo->gs_value = seqinfo->gs_init_value; seqinfo->gs_called = true; GTM_RWLockRelease(&seqinfo->gs_lock); seq_release_seqinfo(seqinfo); @@ -749,9 +743,9 @@ GTM_SeqGetNext(GTM_SequenceKey seqkey) * InvalidSequenceValue */ if (seqinfo->gs_max_value - seqinfo->gs_increment_by >= seqinfo->gs_value) - value = seqinfo->gs_value = seqinfo->gs_value + seqinfo->gs_increment_by; + value = seqinfo->gs_last_value = seqinfo->gs_value = seqinfo->gs_value + seqinfo->gs_increment_by; else if (SEQ_IS_CYCLE(seqinfo)) - value = seqinfo->gs_value = seqinfo->gs_min_value; + value = seqinfo->gs_last_value = seqinfo->gs_value = seqinfo->gs_min_value; else { GTM_RWLockRelease(&seqinfo->gs_lock); @@ -774,9 +768,9 @@ GTM_SeqGetNext(GTM_SequenceKey seqkey) * descending sequences. So we don't need special handling below */ if (seqinfo->gs_min_value - seqinfo->gs_increment_by <= seqinfo->gs_value) - value = seqinfo->gs_value = seqinfo->gs_value + seqinfo->gs_increment_by; + value = seqinfo->gs_value = seqinfo->gs_last_value = seqinfo->gs_value + seqinfo->gs_increment_by; else if (SEQ_IS_CYCLE(seqinfo)) - value = seqinfo->gs_value = seqinfo->gs_max_value; + value = seqinfo->gs_value = seqinfo->gs_last_value = seqinfo->gs_max_value; else { GTM_RWLockRelease(&seqinfo->gs_lock); @@ -810,7 +804,7 @@ GTM_SeqReset(GTM_SequenceKey seqkey) } GTM_RWLockAcquire(&seqinfo->gs_lock, GTM_LOCKMODE_WRITE); - seqinfo->gs_value = seqinfo->gs_init_value; + seqinfo->gs_value = seqinfo->gs_last_value = seqinfo->gs_init_value; GTM_RWLockRelease(&seqinfo->gs_lock); seq_release_seqinfo(seqinfo); ----------------------------------------------------------------------- Summary of changes: src/backend/commands/sequence.c | 38 +++++++++++++++++++------------------- src/gtm/main/gtm_seq.c | 26 ++++++++++---------------- 2 files changed, 29 insertions(+), 35 deletions(-) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-03-10 06:09:49
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via 95854dc24142a7ee751c05d658f52d84fc0649dc (commit) from e0df08e39ab62378dcb7d11e259c5e1474104e0f (commit) - Log ----------------------------------------------------------------- commit 95854dc24142a7ee751c05d658f52d84fc0649dc Author: Michael P <mic...@us...> Date: Thu Mar 10 15:08:11 2011 +0900 Fix for regression test box It is not possible to use ORDER BY for an object of type box, so the output file for 2 Datanodes is added. diff --git a/src/test/regress/expected/box_1.out b/src/test/regress/expected/box_1.out new file mode 100644 index 0000000..7bd428a --- /dev/null +++ b/src/test/regress/expected/box_1.out @@ -0,0 +1,218 @@ +-- +-- BOX +-- +-- +-- box logic +-- o +-- 3 o--|X +-- | o| +-- 2 +-+-+ | +-- | | | | +-- 1 | o-+-o +-- | | +-- 0 +---+ +-- +-- 0 1 2 3 +-- +-- boxes are specified by two points, given by four floats x1,y1,x2,y2 +CREATE TABLE BOX_TBL (f1 box); +INSERT INTO BOX_TBL (f1) VALUES ('(2.0,2.0,0.0,0.0)'); +INSERT INTO BOX_TBL (f1) VALUES ('(1.0,1.0,3.0,3.0)'); +-- degenerate cases where the box is a line or a point +-- note that lines and points boxes all have zero area +INSERT INTO BOX_TBL (f1) VALUES ('(2.5, 2.5, 2.5,3.5)'); +INSERT INTO BOX_TBL (f1) VALUES ('(3.0, 3.0,3.0,3.0)'); +-- badly formatted box inputs +INSERT INTO BOX_TBL (f1) VALUES ('(2.3, 4.5)'); +ERROR: invalid input syntax for type box: "(2.3, 4.5)" +LINE 1: INSERT INTO BOX_TBL (f1) VALUES ('(2.3, 4.5)'); + ^ +INSERT INTO BOX_TBL (f1) VALUES ('asdfasdf(ad'); +ERROR: invalid input syntax for type box: "asdfasdf(ad" +LINE 1: INSERT INTO BOX_TBL (f1) VALUES ('asdfasdf(ad'); + ^ +SELECT '' AS four, * FROM BOX_TBL; + four | f1 +------+--------------------- + | (3,3),(1,1) + | (3,3),(3,3) + | (2,2),(0,0) + | (2.5,3.5),(2.5,2.5) +(4 rows) + +SELECT '' AS four, b.*, area(b.f1) as barea + FROM BOX_TBL b ORDER BY (b.f1[0])[0], (b.f1[0])[1], (b.f1[2])[0], (b.f1[2])[1]; + four | f1 | barea +------+---------------------+------- + | (2,2),(0,0) | 4 + | (2.5,3.5),(2.5,2.5) | 0 + | (3,3),(1,1) | 4 + | (3,3),(3,3) | 0 +(4 rows) + +-- overlap +SELECT '' AS three, b.f1 + FROM BOX_TBL b + WHERE b.f1 && box '(2.5,2.5,1.0,1.0)' ORDER BY (b.f1[0])[0], (b.f1[0])[1], (b.f1[2])[0], (b.f1[2])[1]; + three | f1 +-------+--------------------- + | (2,2),(0,0) + | (2.5,3.5),(2.5,2.5) + | (3,3),(1,1) +(3 rows) + +-- left-or-overlap (x only) +SELECT '' AS two, b1.* + FROM BOX_TBL b1 + WHERE b1.f1 &< box '(2.0,2.0,2.5,2.5)' ORDER BY (b1.f1[0])[0], (b1.f1[0])[1], (b1.f1[2])[0], (b1.f1[2])[1]; + two | f1 +-----+--------------------- + | (2,2),(0,0) + | (2.5,3.5),(2.5,2.5) +(2 rows) + +-- right-or-overlap (x only) +SELECT '' AS two, b1.* + FROM BOX_TBL b1 + WHERE b1.f1 &> box '(2.0,2.0,2.5,2.5)' ORDER BY (b1.f1[0])[0], (b1.f1[0])[1], (b1.f1[2])[0], (b1.f1[2])[1]; + two | f1 +-----+--------------------- + | (2.5,3.5),(2.5,2.5) + | (3,3),(3,3) +(2 rows) + +-- left of +SELECT '' AS two, b.f1 + FROM BOX_TBL b + WHERE b.f1 << box '(3.0,3.0,5.0,5.0)' ORDER BY (b.f1[0])[0], (b.f1[0])[1], (b.f1[2])[0], (b.f1[2])[1]; + two | f1 +-----+--------------------- + | (2,2),(0,0) + | (2.5,3.5),(2.5,2.5) +(2 rows) + +-- area <= +SELECT '' AS four, b.f1 + FROM BOX_TBL b + WHERE b.f1 <= box '(3.0,3.0,5.0,5.0)' ORDER BY (b.f1[0])[0], (b.f1[0])[1], (b.f1[2])[0], (b.f1[2])[1]; + four | f1 +------+--------------------- + | (2,2),(0,0) + | (2.5,3.5),(2.5,2.5) + | (3,3),(1,1) + | (3,3),(3,3) +(4 rows) + +-- area < +SELECT '' AS two, b.f1 + FROM BOX_TBL b + WHERE b.f1 < box '(3.0,3.0,5.0,5.0)' ORDER BY (b.f1[0])[0], (b.f1[0])[1], (b.f1[2])[0], (b.f1[2])[1]; + two | f1 +-----+--------------------- + | (2.5,3.5),(2.5,2.5) + | (3,3),(3,3) +(2 rows) + +-- area = +SELECT '' AS two, b.f1 + FROM BOX_TBL b + WHERE b.f1 = box '(3.0,3.0,5.0,5.0)' ORDER BY (b.f1[0])[0], (b.f1[0])[1], (b.f1[2])[0], (b.f1[2])[1]; + two | f1 +-----+------------- + | (2,2),(0,0) + | (3,3),(1,1) +(2 rows) + +-- area > +SELECT '' AS two, b.f1 + FROM BOX_TBL b -- zero area + WHERE b.f1 > box '(3.5,3.0,4.5,3.0)' ORDER BY (b.f1[0])[0], (b.f1[0])[1], (b.f1[2])[0], (b.f1[2])[1]; + two | f1 +-----+------------- + | (2,2),(0,0) + | (3,3),(1,1) +(2 rows) + +-- area >= +SELECT '' AS four, b.f1 + FROM BOX_TBL b -- zero area + WHERE b.f1 >= box '(3.5,3.0,4.5,3.0)' ORDER BY (b.f1[0])[0], (b.f1[0])[1], (b.f1[2])[0], (b.f1[2])[1]; + four | f1 +------+--------------------- + | (2,2),(0,0) + | (2.5,3.5),(2.5,2.5) + | (3,3),(1,1) + | (3,3),(3,3) +(4 rows) + +-- right of +SELECT '' AS two, b.f1 + FROM BOX_TBL b + WHERE box '(3.0,3.0,5.0,5.0)' >> b.f1 ORDER BY (b.f1[0])[0], (b.f1[0])[1], (b.f1[2])[0], (b.f1[2])[1]; + two | f1 +-----+--------------------- + | (2,2),(0,0) + | (2.5,3.5),(2.5,2.5) +(2 rows) + +-- contained in +SELECT '' AS three, b.f1 + FROM BOX_TBL b + WHERE b.f1 <@ box '(0,0,3,3)' ORDER BY (b.f1[0])[0], (b.f1[0])[1], (b.f1[2])[0], (b.f1[2])[1]; + three | f1 +-------+------------- + | (2,2),(0,0) + | (3,3),(1,1) + | (3,3),(3,3) +(3 rows) + +-- contains +SELECT '' AS three, b.f1 + FROM BOX_TBL b + WHERE box '(0,0,3,3)' @> b.f1 ORDER BY (b.f1[0])[0], (b.f1[0])[1], (b.f1[2])[0], (b.f1[2])[1]; + three | f1 +-------+------------- + | (2,2),(0,0) + | (3,3),(1,1) + | (3,3),(3,3) +(3 rows) + +-- box equality +SELECT '' AS one, b.f1 + FROM BOX_TBL b + WHERE box '(1,1,3,3)' ~= b.f1 ORDER BY (b.f1[0])[0], (b.f1[0])[1], (b.f1[2])[0], (b.f1[2])[1]; + one | f1 +-----+------------- + | (3,3),(1,1) +(1 row) + +-- center of box, left unary operator +SELECT '' AS four, @@(b1.f1) AS p + FROM BOX_TBL b1 ORDER BY (b1.f1[0])[0], (b1.f1[0])[1], (b1.f1[2])[0], (b1.f1[2])[1]; + four | p +------+--------- + | (1,1) + | (2.5,3) + | (2,2) + | (3,3) +(4 rows) + +-- wholly-contained +SELECT '' AS one, b1.*, b2.* + FROM BOX_TBL b1, BOX_TBL b2 + WHERE b1.f1 @> b2.f1 and not b1.f1 ~= b2.f1 + ORDER BY (b1.f1[0])[0], (b1.f1[0])[1], (b1.f1[2])[0], (b1.f1[2])[1], (b2.f1[0])[0], (b2.f1[0])[1], (b2.f1[2])[0], (b2.f1[2])[1]; + one | f1 | f1 +-----+-------------+------------- + | (3,3),(1,1) | (3,3),(3,3) +(1 row) + +SELECT '' AS four, height(f1), width(f1) FROM BOX_TBL ORDER BY (f1[0])[0], (f1[0])[1], (f1[2])[0], (f1[2])[1]; + four | height | width +------+--------+------- + | 2 | 2 + | 1 | 0 + | 2 | 2 + | 0 | 0 +(4 rows) + ----------------------------------------------------------------------- Summary of changes: src/test/regress/expected/{box.out => box_1.out} | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) copy src/test/regress/expected/{box.out => box_1.out} (100%) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-03-10 05:46:28
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via e0df08e39ab62378dcb7d11e259c5e1474104e0f (commit) from 09a00e32319f4af6f2cab879ed1fae866164eca5 (commit) - Log ----------------------------------------------------------------- commit e0df08e39ab62378dcb7d11e259c5e1474104e0f Author: Michael P <mic...@us...> Date: Thu Mar 10 14:42:35 2011 +0900 Fix for bug 3201711: Sequence view crash This query was pushed down to Datanodes, but it has to be launched on Local Coordinator. CREATE SEQUENCE foo; select * from foo; This fix is important for pg_admin. diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c index e812025..0497180 100644 --- a/src/backend/optimizer/path/allpaths.c +++ b/src/backend/optimizer/path/allpaths.c @@ -35,6 +35,7 @@ #include "parser/parsetree.h" #ifdef PGXC #include "catalog/pg_namespace.h" +#include "catalog/pg_class.h" #include "pgxc/pgxc.h" #endif #include "rewrite/rewriteManip.h" @@ -261,11 +262,13 @@ set_plain_rel_pathlist(PlannerInfo *root, RelOptInfo *rel, RangeTblEntry *rte) #ifdef PGXC /* * If we are on the coordinator, we always want to use - * the remote query path unless it is a pg_catalog table. + * the remote query path unless it is a pg_catalog table + * or a sequence relation. */ if (IS_PGXC_COORDINATOR && !IsConnFromCoord() && - get_rel_namespace(rte->relid) != PG_CATALOG_NAMESPACE) + get_rel_namespace(rte->relid) != PG_CATALOG_NAMESPACE && + get_rel_relkind(rte->relid) != RELKIND_SEQUENCE) add_path(rel, create_remotequery_path(root, rel)); else { diff --git a/src/backend/pgxc/plan/planner.c b/src/backend/pgxc/plan/planner.c index 622834e..e4d13cb 100644 --- a/src/backend/pgxc/plan/planner.c +++ b/src/backend/pgxc/plan/planner.c @@ -1573,7 +1573,13 @@ get_plan_nodes_walker(Node *query_node, XCWalkerContext *context) if (get_rel_namespace(rte->relid) == PG_CATALOG_NAMESPACE) current_usage_type = TABLE_USAGE_TYPE_PGCATALOG; else - current_usage_type = TABLE_USAGE_TYPE_USER; + { + /* Check if this relation is a sequence */ + if (get_rel_relkind(rte->relid) == RELKIND_SEQUENCE) + current_usage_type = TABLE_USAGE_TYPE_SEQUENCE; + else + current_usage_type = TABLE_USAGE_TYPE_USER; + } } else if (rte->rtekind == RTE_FUNCTION) { @@ -1607,11 +1613,12 @@ get_plan_nodes_walker(Node *query_node, XCWalkerContext *context) } } - /* If we are just dealing with pg_catalog, just return. */ - if (table_usage_type == TABLE_USAGE_TYPE_PGCATALOG) + /* If we are just dealing with pg_catalog or a sequence, just return. */ + if (table_usage_type == TABLE_USAGE_TYPE_PGCATALOG || + table_usage_type == TABLE_USAGE_TYPE_SEQUENCE) { context->query_step->exec_nodes = makeNode(ExecNodes); - context->query_step->exec_nodes->tableusagetype = TABLE_USAGE_TYPE_PGCATALOG; + context->query_step->exec_nodes->tableusagetype = table_usage_type; context->exec_on_coord = true; return false; } diff --git a/src/include/pgxc/locator.h b/src/include/pgxc/locator.h index 5948fae..3272ab6 100644 --- a/src/include/pgxc/locator.h +++ b/src/include/pgxc/locator.h @@ -39,6 +39,7 @@ typedef enum { TABLE_USAGE_TYPE_NO_TABLE, TABLE_USAGE_TYPE_PGCATALOG, + TABLE_USAGE_TYPE_SEQUENCE, TABLE_USAGE_TYPE_USER, TABLE_USAGE_TYPE_USER_REPLICATED, /* based on a replicated table */ TABLE_USAGE_TYPE_MIXED ----------------------------------------------------------------------- Summary of changes: src/backend/optimizer/path/allpaths.c | 7 +++++-- src/backend/pgxc/plan/planner.c | 15 +++++++++++---- src/include/pgxc/locator.h | 1 + 3 files changed, 17 insertions(+), 6 deletions(-) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-03-10 01:22:39
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via 09a00e32319f4af6f2cab879ed1fae866164eca5 (commit) from baed9de74d766b401d088918e809dc9e51b313f7 (commit) - Log ----------------------------------------------------------------- commit 09a00e32319f4af6f2cab879ed1fae866164eca5 Author: Michael P <mic...@us...> Date: Thu Mar 10 10:21:19 2011 +0900 Block SERIAL sequences XC does not support yet serial sequences when creating tables. diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c index 1777199..3ffc570 100644 --- a/src/backend/parser/parse_utilcmd.c +++ b/src/backend/parser/parse_utilcmd.c @@ -362,6 +362,13 @@ transformColumnDefinition(ParseState *pstate, CreateStmtContext *cxt, AlterSeqStmt *altseqstmt; List *attnamelist; +#ifdef PGXC + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("Postgres-XC does not support SERIAL yet"), + errdetail("The feature is not currently supported"))); +#endif + /* * Determine namespace and name to use for the sequence. * ----------------------------------------------------------------------- Summary of changes: src/backend/parser/parse_utilcmd.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) hooks/post-receive -- Postgres-XC |
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 |
From: Abbas B. <ga...@us...> - 2011-03-08 16:18:11
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via f9690c125d5657cdf8b4c2d9e441d4fe62edf223 (commit) from 60fd3944c0015203d62ae4bb49f209bc0a3b827b (commit) - Log ----------------------------------------------------------------- commit f9690c125d5657cdf8b4c2d9e441d4fe62edf223 Author: Abbas <abb...@en...> Date: Tue Mar 8 21:17:29 2011 +0500 GetRelationLocInfo can return NULL, this patch adds check for a NULL return at missing places diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c index 4737067..64eab92 100644 --- a/src/backend/catalog/heap.c +++ b/src/backend/catalog/heap.c @@ -855,7 +855,10 @@ AddRelationDistribution (Oid relid, parentOid = linitial_oid(parentOids); rel_loc_info = GetRelationLocInfo(parentOid); - locatortype = rel_loc_info->locatorType; + if (rel_loc_info) + locatortype = rel_loc_info->locatorType; + else + locatortype = LOCATOR_TYPE_REPLICATED; switch (locatortype) { diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c index ecd1f52..6114dd2 100644 --- a/src/backend/optimizer/plan/createplan.c +++ b/src/backend/optimizer/plan/createplan.c @@ -2415,7 +2415,10 @@ create_remotequery_plan(PlannerInfo *root, Path *best_path, rel_loc_info = GetRelationLocInfo(rte->relid); scan_plan->exec_nodes = makeNode(ExecNodes); scan_plan->exec_nodes->tableusagetype = TABLE_USAGE_TYPE_USER; - scan_plan->exec_nodes->baselocatortype = rel_loc_info->locatorType; + if (rel_loc_info) + scan_plan->exec_nodes->baselocatortype = rel_loc_info->locatorType; + else + scan_plan->exec_nodes->baselocatortype = '\0'; scan_plan->exec_nodes = GetRelationNodes(rel_loc_info, NULL, RELATION_ACCESS_READ); diff --git a/src/backend/pgxc/plan/planner.c b/src/backend/pgxc/plan/planner.c index 378d9b4..622834e 100644 --- a/src/backend/pgxc/plan/planner.c +++ b/src/backend/pgxc/plan/planner.c @@ -762,6 +762,9 @@ examine_conditions_walker(Node *expr_node, XCWalkerContext *context) RangeTblEntry *table = (RangeTblEntry *) linitial(context->query->rtable); node_cursor = step->cursor; rel_loc_info1 = GetRelationLocInfo(table->relid); + if (!rel_loc_info1) + return true; + context->query_step->exec_nodes = makeNode(ExecNodes); context->query_step->exec_nodes->tableusagetype = TABLE_USAGE_TYPE_USER; context->query_step->exec_nodes->baselocatortype = rel_loc_info1->locatorType; @@ -1121,6 +1124,9 @@ examine_conditions_walker(Node *expr_node, XCWalkerContext *context) if (!column_base2) return true; rel_loc_info2 = GetRelationLocInfo(column_base2->relid); + if (!rel_loc_info2) + return true; + /* get data struct about these two relations joining */ pgxc_join = find_or_create_pgxc_join(column_base->relid, column_base->relalias, diff --git a/src/backend/rewrite/rewriteHandler.c b/src/backend/rewrite/rewriteHandler.c index 85f397d..78850bb 100644 --- a/src/backend/rewrite/rewriteHandler.c +++ b/src/backend/rewrite/rewriteHandler.c @@ -2309,6 +2309,9 @@ RewriteInsertStmt(Query *query, RangeTblEntry *values_rte) rte = (RangeTblEntry *) list_nth(query->rtable, query->resultRelation - 1); rte_loc_info = GetRelationLocInfo(rte->relid); + if (!rte_loc_info) + return NULL; + locatorType = rte_loc_info->locatorType; partColName = rte_loc_info->partAttrName; ----------------------------------------------------------------------- Summary of changes: src/backend/catalog/heap.c | 5 ++++- src/backend/optimizer/plan/createplan.c | 5 ++++- src/backend/pgxc/plan/planner.c | 6 ++++++ src/backend/rewrite/rewriteHandler.c | 3 +++ 4 files changed, 17 insertions(+), 2 deletions(-) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-03-08 08:10:47
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via 60fd3944c0015203d62ae4bb49f209bc0a3b827b (commit) from 3af192ad45f2e21a74d032faa4612259606aa266 (commit) - Log ----------------------------------------------------------------- commit 60fd3944c0015203d62ae4bb49f209bc0a3b827b Author: Michael P <mic...@us...> Date: Tue Mar 8 17:09:38 2011 +0900 Block TEMP SEQUENCE and TABLESPACE Those features are not supported yet. diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c index 8646f9c..ee19184 100644 --- a/src/backend/commands/sequence.c +++ b/src/backend/commands/sequence.c @@ -146,6 +146,14 @@ DefineSequence(CreateSeqStmt *seq) init_params(seq->options, true, &new, &owned_by); #endif +#ifdef PGXC + if (seq->sequence->istemp) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("Postgres-XC does not support TEMPORARY SEQUENCE yet"), + errdetail("The feature is not currently supported"))); +#endif + /* * Create relation (and fill value[] and null[] for the tuple) */ diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index 3ff5ced..c278ea0 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -661,6 +661,12 @@ standard_ProcessUtility(Node *parsetree, break; case T_CreateTableSpaceStmt: +#ifdef PGXC + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("Postgres-XC does not support TABLESPACE yet"), + errdetail("The feature is not currently supported"))); +#endif PreventTransactionChain(isTopLevel, "CREATE TABLESPACE"); CreateTableSpace((CreateTableSpaceStmt *) parsetree); break; ----------------------------------------------------------------------- Summary of changes: src/backend/commands/sequence.c | 8 ++++++++ src/backend/tcop/utility.c | 6 ++++++ 2 files changed, 14 insertions(+), 0 deletions(-) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-03-08 05:16:26
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via 3af192ad45f2e21a74d032faa4612259606aa266 (commit) from ab949a7cb237c6966a19204b23aea6c931928961 (commit) - Log ----------------------------------------------------------------- commit 3af192ad45f2e21a74d032faa4612259606aa266 Author: Michael P <mic...@us...> Date: Tue Mar 8 14:14:11 2011 +0900 Block FOREIGN constraint creation This prevents a crash in truncate test of pg_regress. Correct error messages for non-supported features. diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c index 822ca0b..30f5cd9 100644 --- a/src/backend/parser/parse_utilcmd.c +++ b/src/backend/parser/parse_utilcmd.c @@ -1585,6 +1585,12 @@ transformFKConstraints(ParseState *pstate, CreateStmtContext *cxt, constraint->skip_validation = true; #ifdef PGXC + if (constraint->contype == CONSTR_FOREIGN) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("Postgres-XC does not support FOREIGN constraints yet"), + errdetail("The feature is not currently supported"))); + /* * Set fallback distribution column. * If not yet set, set it to first column in FK constraint diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index a48c4a3..3ff5ced 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -807,7 +807,8 @@ standard_ProcessUtility(Node *parsetree, #ifdef PGXC ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("PREPARE is not supported"))); + errmsg("Postgres-XC does not support PREPARE yet"), + errdetail("The feature is not currently supported"))); #endif CheckRestrictedOperation("PREPARE"); PrepareQuery((PrepareStmt *) parsetree, queryString); @@ -817,7 +818,8 @@ standard_ProcessUtility(Node *parsetree, #ifdef PGXC ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("EXECUTE is not supported"))); + errmsg("Postgres-XC does not support EXECUTE yet"), + errdetail("The feature is not currently supported"))); #endif ExecuteQuery((ExecuteStmt *) parsetree, queryString, params, dest, completionTag); @@ -1062,8 +1064,8 @@ standard_ProcessUtility(Node *parsetree, { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("PGXC does not support concurrent indexes"), - errdetail("The feature is not currently supported"))); + errmsg("PGXC does not support concurrent INDEX yet"), + errdetail("The feature is not currently supported"))); } #endif @@ -1311,7 +1313,8 @@ standard_ProcessUtility(Node *parsetree, /* Postgres-XC does not support yet triggers */ ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("TRIGGER is not supported"))); + errmsg("Postgres-XC does not support TRIGGER yet"), + errdetail("The feature is not currently supported"))); if (IS_PGXC_COORDINATOR) ExecUtilityStmtOnNodes(queryString, NULL, false, EXEC_ON_ALL_NODES); ----------------------------------------------------------------------- Summary of changes: src/backend/parser/parse_utilcmd.c | 6 ++++++ src/backend/tcop/utility.c | 13 ++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-03-08 03:58:22
|
Project "Postgres-XC". The branch, ha_support has been updated via c6be69cf56ee25852b90728f677b09b834e46fec (commit) from 6ee7a8fb4ca7ca60504b443da95c0c3314b1c88d (commit) - Log ----------------------------------------------------------------- commit c6be69cf56ee25852b90728f677b09b834e46fec Author: Michael P <mic...@us...> Date: Tue Mar 8 12:53:20 2011 +0900 Fix for 2PC data extension Node list was not set correctly, resulting in data inconsistency in this pg_prepared_xact() diff --git a/src/backend/access/transam/twophase.c b/src/backend/access/transam/twophase.c index de766ff..d1df279 100644 --- a/src/backend/access/transam/twophase.c +++ b/src/backend/access/transam/twophase.c @@ -360,7 +360,7 @@ MarkAsPreparing(TransactionId xid, const char *gid, strcpy(gxact->gid, gid); #ifdef PGXC /* Add also the records associated to a PGXC 2PC */ - memcpy(gxact->nodelist, PGXC2PCData->nodelist, strlen(PGXC2PCData->nodelist)); + memcpy(gxact->nodelist, PGXC2PCData->nodelist, strlen(PGXC2PCData->nodelist) + 1); gxact->isimplicit = PGXC2PCData->isimplicit; gxact->isddl = PGXC2PCData->isddl; gxact->coordnum = PGXC2PCData->coordnum; ----------------------------------------------------------------------- Summary of changes: src/backend/access/transam/twophase.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-03-08 02:49:53
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via ab949a7cb237c6966a19204b23aea6c931928961 (commit) from 11b8a7940017006e07f7448c9a42e20b11655ba0 (commit) - Log ----------------------------------------------------------------- commit ab949a7cb237c6966a19204b23aea6c931928961 Author: Michael P <mic...@us...> Date: Tue Mar 8 11:47:58 2011 +0900 Partial fix for regression test temp TEMP tables are not supported yet by Postgre-XC. There is still a couple of issues remaining with whereami and whoami. diff --git a/src/test/regress/expected/temp_1.out b/src/test/regress/expected/temp_1.out new file mode 100644 index 0000000..b966fb3 --- /dev/null +++ b/src/test/regress/expected/temp_1.out @@ -0,0 +1,200 @@ +-- +-- TEMP +-- Test temp relations and indexes +-- +-- test temp table/index masking +CREATE TABLE temptest(col int); +CREATE INDEX i_temptest ON temptest(col); +CREATE TEMP TABLE temptest(tcol int); +ERROR: PG-XC does not yet support temporary tables +CREATE INDEX i_temptest ON temptest(tcol); +ERROR: column "tcol" does not exist +SELECT * FROM temptest; + col +----- +(0 rows) + +DROP INDEX i_temptest; +DROP TABLE temptest; +SELECT * FROM temptest; +ERROR: relation "temptest" does not exist +LINE 1: SELECT * FROM temptest; + ^ +DROP INDEX i_temptest; +ERROR: index "i_temptest" does not exist +DROP TABLE temptest; +ERROR: table "temptest" does not exist +-- test temp table selects +CREATE TABLE temptest(col int); +INSERT INTO temptest VALUES (1); +CREATE TEMP TABLE temptest(tcol float); +ERROR: PG-XC does not yet support temporary tables +INSERT INTO temptest VALUES (2.1); +SELECT * FROM temptest; + col +----- + 1 + 2 +(2 rows) + +DROP TABLE temptest; +SELECT * FROM temptest; +ERROR: relation "temptest" does not exist +LINE 1: SELECT * FROM temptest; + ^ +DROP TABLE temptest; +ERROR: table "temptest" does not exist +-- test temp table deletion +CREATE TEMP TABLE temptest(col int); +ERROR: PG-XC does not yet support temporary tables +\c +SELECT * FROM temptest; +ERROR: relation "temptest" does not exist +LINE 1: SELECT * FROM temptest; + ^ +-- Test ON COMMIT DELETE ROWS +CREATE TEMP TABLE temptest(col int) ON COMMIT DELETE ROWS; +ERROR: PG-XC does not yet support temporary tables +BEGIN; +INSERT INTO temptest VALUES (1); +ERROR: relation "temptest" does not exist +LINE 1: INSERT INTO temptest VALUES (1); + ^ +INSERT INTO temptest VALUES (2); +ERROR: current transaction is aborted, commands ignored until end of transaction block +SELECT * FROM temptest ORDER BY 1; +ERROR: current transaction is aborted, commands ignored until end of transaction block +COMMIT; +SELECT * FROM temptest; +ERROR: relation "temptest" does not exist +LINE 1: SELECT * FROM temptest; + ^ +DROP TABLE temptest; +ERROR: table "temptest" does not exist +BEGIN; +CREATE TEMP TABLE temptest(col) ON COMMIT DELETE ROWS AS SELECT 1; +ERROR: INTO clause not yet supported +SELECT * FROM temptest; +ERROR: current transaction is aborted, commands ignored until end of transaction block +COMMIT; +SELECT * FROM temptest; +ERROR: relation "temptest" does not exist +LINE 1: SELECT * FROM temptest; + ^ +DROP TABLE temptest; +ERROR: table "temptest" does not exist +-- Test ON COMMIT DROP +BEGIN; +CREATE TEMP TABLE temptest(col int) ON COMMIT DROP; +ERROR: PG-XC does not yet support temporary tables +INSERT INTO temptest VALUES (1); +ERROR: current transaction is aborted, commands ignored until end of transaction block +INSERT INTO temptest VALUES (2); +ERROR: current transaction is aborted, commands ignored until end of transaction block +SELECT * FROM temptest ORDER BY 1; +ERROR: current transaction is aborted, commands ignored until end of transaction block +COMMIT; +SELECT * FROM temptest; +ERROR: relation "temptest" does not exist +LINE 1: SELECT * FROM temptest; + ^ +BEGIN; +CREATE TEMP TABLE temptest(col) ON COMMIT DROP AS SELECT 1; +ERROR: INTO clause not yet supported +SELECT * FROM temptest; +ERROR: current transaction is aborted, commands ignored until end of transaction block +COMMIT; +SELECT * FROM temptest; +ERROR: relation "temptest" does not exist +LINE 1: SELECT * FROM temptest; + ^ +-- ON COMMIT is only allowed for TEMP +CREATE TABLE temptest(col int) ON COMMIT DELETE ROWS; +ERROR: ON COMMIT can only be used on temporary tables +CREATE TABLE temptest(col) ON COMMIT DELETE ROWS AS SELECT 1; +ERROR: INTO clause not yet supported +-- Test foreign keys +BEGIN; +CREATE TEMP TABLE temptest1(col int PRIMARY KEY); +ERROR: PG-XC does not yet support temporary tables +CREATE TEMP TABLE temptest2(col int REFERENCES temptest1) + ON COMMIT DELETE ROWS; +ERROR: current transaction is aborted, commands ignored until end of transaction block +INSERT INTO temptest1 VALUES (1); +ERROR: current transaction is aborted, commands ignored until end of transaction block +INSERT INTO temptest2 VALUES (1); +ERROR: current transaction is aborted, commands ignored until end of transaction block +COMMIT; +SELECT * FROM temptest1; +ERROR: relation "temptest1" does not exist +LINE 1: SELECT * FROM temptest1; + ^ +SELECT * FROM temptest2; +ERROR: relation "temptest2" does not exist +LINE 1: SELECT * FROM temptest2; + ^ +BEGIN; +CREATE TEMP TABLE temptest3(col int PRIMARY KEY) ON COMMIT DELETE ROWS; +ERROR: PG-XC does not yet support temporary tables +CREATE TEMP TABLE temptest4(col int REFERENCES temptest3); +ERROR: current transaction is aborted, commands ignored until end of transaction block +COMMIT; +-- Test manipulation of temp schema's placement in search path +create table public.whereami (f1 text); +insert into public.whereami values ('public'); +create temp table whereami (f1 text); +ERROR: PG-XC does not yet support temporary tables +insert into whereami values ('temp'); +create function public.whoami() returns text + as $$select 'public'::text$$ language sql; +create function pg_temp.whoami() returns text + as $$select 'temp'::text$$ language sql; +-- default should have pg_temp implicitly first, but only for tables +select * from whereami; + f1 +------ + temp +(1 row) + +select whoami(); + whoami +-------- + public +(1 row) + +-- can list temp first explicitly, but it still doesn't affect functions +set search_path = pg_temp, public; +select * from whereami; + f1 +------ + temp +(1 row) + +select whoami(); + whoami +-------- + public +(1 row) + +-- or put it last for security +set search_path = public, pg_temp; +select * from whereami; + f1 +-------- + public +(1 row) + +select whoami(); + whoami +-------- + public +(1 row) + +-- you can invoke a temp function explicitly, though +select pg_temp.whoami(); + whoami +-------- + temp +(1 row) + +drop table public.whereami; ----------------------------------------------------------------------- Summary of changes: src/test/regress/expected/{temp.out => temp_1.out} | 113 ++++++++++---------- 1 files changed, 55 insertions(+), 58 deletions(-) copy src/test/regress/expected/{temp.out => temp_1.out} (59%) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-03-08 01:44:36
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via 11b8a7940017006e07f7448c9a42e20b11655ba0 (commit) from 49107f629e3628a89ec4848e167ef9c8e6d2a4e7 (commit) - Log ----------------------------------------------------------------- commit 11b8a7940017006e07f7448c9a42e20b11655ba0 Author: Michael P <mic...@us...> Date: Tue Mar 8 10:43:44 2011 +0900 Block trigger as this feature is not supported diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index 2bb2200..a48c4a3 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -1308,6 +1308,11 @@ standard_ProcessUtility(Node *parsetree, (void) CreateTrigger((CreateTrigStmt *) parsetree, queryString, InvalidOid, InvalidOid, false); #ifdef PGXC + /* Postgres-XC does not support yet triggers */ + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("TRIGGER is not supported"))); + if (IS_PGXC_COORDINATOR) ExecUtilityStmtOnNodes(queryString, NULL, false, EXEC_ON_ALL_NODES); #endif ----------------------------------------------------------------------- Summary of changes: src/backend/tcop/utility.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-03-08 01:28:54
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via 49107f629e3628a89ec4848e167ef9c8e6d2a4e7 (commit) from 901cb86e90d8d286dd0ca3b4c337ed512b28021c (commit) - Log ----------------------------------------------------------------- commit 49107f629e3628a89ec4848e167ef9c8e6d2a4e7 Author: Michael P <mic...@us...> Date: Tue Mar 8 10:27:37 2011 +0900 Fix for regression test txid PG-XC does not support yet TEMP tables. diff --git a/src/test/regress/expected/txid_1.out b/src/test/regress/expected/txid_1.out new file mode 100644 index 0000000..9bb1966 --- /dev/null +++ b/src/test/regress/expected/txid_1.out @@ -0,0 +1,124 @@ +-- txid_snapshot data type and related functions +-- i/o +select '12:13:'::txid_snapshot; + txid_snapshot +--------------- + 12:13: +(1 row) + +select '12:18:14,16'::txid_snapshot; + txid_snapshot +--------------- + 12:18:14,16 +(1 row) + +-- errors +select '31:12:'::txid_snapshot; +ERROR: invalid input for txid_snapshot: "31:12:" +LINE 1: select '31:12:'::txid_snapshot; + ^ +select '0:1:'::txid_snapshot; +ERROR: invalid input for txid_snapshot: "0:1:" +LINE 1: select '0:1:'::txid_snapshot; + ^ +select '12:13:0'::txid_snapshot; +ERROR: invalid input for txid_snapshot: "12:13:0" +LINE 1: select '12:13:0'::txid_snapshot; + ^ +select '12:16:14,13'::txid_snapshot; +ERROR: invalid input for txid_snapshot: "12:16:14,13" +LINE 1: select '12:16:14,13'::txid_snapshot; + ^ +select '12:16:14,14'::txid_snapshot; +ERROR: invalid input for txid_snapshot: "12:16:14,14" +LINE 1: select '12:16:14,14'::txid_snapshot; + ^ +create temp table snapshot_test ( + nr integer, + snap txid_snapshot +); +ERROR: PG-XC does not yet support temporary tables +insert into snapshot_test values (1, '12:13:'); +ERROR: relation "snapshot_test" does not exist +LINE 1: insert into snapshot_test values (1, '12:13:'); + ^ +insert into snapshot_test values (2, '12:20:13,15,18'); +ERROR: relation "snapshot_test" does not exist +LINE 1: insert into snapshot_test values (2, '12:20:13,15,18'); + ^ +insert into snapshot_test values (3, '100001:100009:100005,100007,100008'); +ERROR: relation "snapshot_test" does not exist +LINE 1: insert into snapshot_test values (3, '100001:100009:100005,1... + ^ +insert into snapshot_test values (4, '100:150:101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131'); +ERROR: relation "snapshot_test" does not exist +LINE 1: insert into snapshot_test values (4, '100:150:101,102,103,10... + ^ +select snap from snapshot_test order by nr; +ERROR: relation "snapshot_test" does not exist +LINE 1: select snap from snapshot_test order by nr; + ^ +select txid_snapshot_xmin(snap), + txid_snapshot_xmax(snap), + txid_snapshot_xip(snap) +from snapshot_test order by nr; +ERROR: relation "snapshot_test" does not exist +LINE 4: from snapshot_test order by nr; + ^ +select id, txid_visible_in_snapshot(id, snap) +from snapshot_test, generate_series(11, 21) id +where nr = 2; +ERROR: relation "snapshot_test" does not exist +LINE 2: from snapshot_test, generate_series(11, 21) id + ^ +-- test bsearch +select id, txid_visible_in_snapshot(id, snap) +from snapshot_test, generate_series(90, 160) id +where nr = 4; +ERROR: relation "snapshot_test" does not exist +LINE 2: from snapshot_test, generate_series(90, 160) id + ^ +-- test current values also +select txid_current() >= txid_snapshot_xmin(txid_current_snapshot()); + ?column? +---------- + t +(1 row) + +-- we can't assume current is always less than xmax, however +select txid_visible_in_snapshot(txid_current(), txid_current_snapshot()); + txid_visible_in_snapshot +-------------------------- + f +(1 row) + +-- test 64bitness +select txid_snapshot '1000100010001000:1000100010001100:1000100010001012,1000100010001013'; + txid_snapshot +--------------------------------------------------------------------- + 1000100010001000:1000100010001100:1000100010001012,1000100010001013 +(1 row) + +select txid_visible_in_snapshot('1000100010001012', '1000100010001000:1000100010001100:1000100010001012,1000100010001013'); + txid_visible_in_snapshot +-------------------------- + f +(1 row) + +select txid_visible_in_snapshot('1000100010001015', '1000100010001000:1000100010001100:1000100010001012,1000100010001013'); + txid_visible_in_snapshot +-------------------------- + t +(1 row) + +-- test 64bit overflow +SELECT txid_snapshot '1:9223372036854775807:3'; + txid_snapshot +------------------------- + 1:9223372036854775807:3 +(1 row) + +SELECT txid_snapshot '1:9223372036854775808:3'; +ERROR: invalid input for txid_snapshot: "1:9223372036854775808:3" +LINE 1: SELECT txid_snapshot '1:9223372036854775808:3'; + ^ ----------------------------------------------------------------------- Summary of changes: src/test/regress/expected/txid_1.out | 124 ++++++++++++++++++++++++++++++++++ 1 files changed, 124 insertions(+), 0 deletions(-) create mode 100644 src/test/regress/expected/txid_1.out hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-03-08 01:15:40
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via 901cb86e90d8d286dd0ca3b4c337ed512b28021c (commit) from 4200394d48340e4a304f4f5f6ac3c4668445f6e4 (commit) - Log ----------------------------------------------------------------- commit 901cb86e90d8d286dd0ca3b4c337ed512b28021c Author: Michael P <mic...@us...> Date: Tue Mar 8 10:14:22 2011 +0900 Fix for regression test create_table INHERITS based on multiple parents is not supported in XC. diff --git a/src/test/regress/expected/create_table_1.out b/src/test/regress/expected/create_table_1.out new file mode 100644 index 0000000..76a1b71 --- /dev/null +++ b/src/test/regress/expected/create_table_1.out @@ -0,0 +1,202 @@ +-- +-- CREATE_TABLE +-- +-- +-- CLASS DEFINITIONS +-- +CREATE TABLE hobbies_r ( + name text, + person text +); +CREATE TABLE equipment_r ( + name text, + hobby text +); +CREATE TABLE onek ( + unique1 int4, + unique2 int4, + two int4, + four int4, + ten int4, + twenty int4, + hundred int4, + thousand int4, + twothousand int4, + fivethous int4, + tenthous int4, + odd int4, + even int4, + stringu1 name, + stringu2 name, + string4 name +); +CREATE TABLE tenk1 ( + unique1 int4, + unique2 int4, + two int4, + four int4, + ten int4, + twenty int4, + hundred int4, + thousand int4, + twothousand int4, + fivethous int4, + tenthous int4, + odd int4, + even int4, + stringu1 name, + stringu2 name, + string4 name +) WITH OIDS; +CREATE TABLE tenk2 ( + unique1 int4, + unique2 int4, + two int4, + four int4, + ten int4, + twenty int4, + hundred int4, + thousand int4, + twothousand int4, + fivethous int4, + tenthous int4, + odd int4, + even int4, + stringu1 name, + stringu2 name, + string4 name +); +CREATE TABLE person ( + name text, + age int4, + location point +); +CREATE TABLE emp ( + salary int4, + manager name +) INHERITS (person) WITH OIDS; +CREATE TABLE student ( + gpa float8 +) INHERITS (person); +CREATE TABLE stud_emp ( + percent int4 +) INHERITS (emp, student); +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 +); +CREATE TABLE slow_emp4000 ( + home_base box +); +CREATE TABLE fast_emp4000 ( + home_base box +); +CREATE TABLE road ( + name text, + thepath path +); +CREATE TABLE ihighway () INHERITS (road); +CREATE TABLE shighway ( + surface text +) INHERITS (road); +CREATE TABLE real_city ( + pop int4, + cname text, + outline path +); +-- +-- test the "star" operators a bit more thoroughly -- this time, +-- throw in lots of NULL fields... +-- +-- a is the type root +-- b and c inherit from a (one-level single inheritance) +-- d inherits from b and c (two-level multiple inheritance) +-- e inherits from c (two-level single inheritance) +-- f inherits from e (three-level single inheritance) +-- +CREATE TABLE a_star ( + class char, + a int4 +); +CREATE TABLE b_star ( + b text +) INHERITS (a_star); +CREATE TABLE c_star ( + c name +) INHERITS (a_star); +CREATE TABLE d_star ( + d float8 +) INHERITS (b_star, c_star); +ERROR: Cannot currently distribute a table with more than one parent. +CREATE TABLE e_star ( + e int2 +) INHERITS (c_star); +CREATE TABLE f_star ( + f polygon +) INHERITS (e_star); +CREATE TABLE aggtest ( + a int2, + b float4 +); +CREATE TABLE hash_i4_heap ( + seqno int4, + random int4 +); +CREATE TABLE hash_name_heap ( + seqno int4, + random name +); +CREATE TABLE hash_txt_heap ( + seqno int4, + random text +); +CREATE TABLE hash_f8_heap ( + seqno int4, + random float8 +); +-- don't include the hash_ovfl_heap stuff in the distribution +-- the data set is too large for what it's worth +-- +-- CREATE TABLE hash_ovfl_heap ( +-- x int4, +-- y int4 +-- ); +CREATE TABLE bt_i4_heap ( + seqno int4, + random int4 +); +CREATE TABLE bt_name_heap ( + seqno name, + random int4 +); +CREATE TABLE bt_txt_heap ( + seqno text, + random int4 +); +CREATE TABLE bt_f8_heap ( + seqno float8, + random int4 +); +CREATE TABLE array_op_test ( + seqno int4, + i int4[], + t text[] +); +CREATE TABLE array_index_op_test ( + seqno int4, + i int4[], + t text[] +); +CREATE TABLE test_tsvector( + t text, + a tsvector +); ----------------------------------------------------------------------- Summary of changes: .../create_table_1.out} | 47 ++----------------- 1 files changed, 5 insertions(+), 42 deletions(-) copy src/test/regress/{sql/create_table.sql => expected/create_table_1.out} (93%) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-03-08 01:06:24
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via 4200394d48340e4a304f4f5f6ac3c4668445f6e4 (commit) via fa1747011efd3841353894a0500e31411b4f4efa (commit) via 637f46cda04fee2d9d4bd78c1c9f4f07373aece5 (commit) via 405874a1f0d9b6634349bcee5165cd7e305ba81a (commit) from 94b048a92d21bd787294cabd3a144cf69badd419 (commit) - Log ----------------------------------------------------------------- commit 4200394d48340e4a304f4f5f6ac3c4668445f6e4 Author: Michael P <mic...@us...> Date: Tue Mar 8 10:04:45 2011 +0900 Partial fix for regression test float fix There is still a diff linked to an error message. diff --git a/src/test/regress/expected/float8_1.out b/src/test/regress/expected/float8_1.out new file mode 100644 index 0000000..1f79f66 --- /dev/null +++ b/src/test/regress/expected/float8_1.out @@ -0,0 +1,447 @@ +-- +-- FLOAT8 +-- +CREATE TABLE FLOAT8_TBL(f1 float8); +INSERT INTO FLOAT8_TBL(f1) VALUES (' 0.0 '); +INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30 '); +INSERT INTO FLOAT8_TBL(f1) VALUES (' -34.84'); +INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200'); +INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200'); +-- test for underflow and overflow handling +SELECT '10e400'::float8; +ERROR: "10e400" is out of range for type double precision +LINE 1: SELECT '10e400'::float8; + ^ +SELECT '-10e400'::float8; +ERROR: "-10e400" is out of range for type double precision +LINE 1: SELECT '-10e400'::float8; + ^ +SELECT '10e-400'::float8; +ERROR: "10e-400" is out of range for type double precision +LINE 1: SELECT '10e-400'::float8; + ^ +SELECT '-10e-400'::float8; +ERROR: "-10e-400" is out of range for type double precision +LINE 1: SELECT '-10e-400'::float8; + ^ +-- bad input +INSERT INTO FLOAT8_TBL(f1) VALUES (''); +ERROR: invalid input syntax for type double precision: "" +LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES (''); + ^ +INSERT INTO FLOAT8_TBL(f1) VALUES (' '); +ERROR: invalid input syntax for type double precision: " " +LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES (' '); + ^ +INSERT INTO FLOAT8_TBL(f1) VALUES ('xyz'); +ERROR: invalid input syntax for type double precision: "xyz" +LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('xyz'); + ^ +INSERT INTO FLOAT8_TBL(f1) VALUES ('5.0.0'); +ERROR: invalid input syntax for type double precision: "5.0.0" +LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('5.0.0'); + ^ +INSERT INTO FLOAT8_TBL(f1) VALUES ('5 . 0'); +ERROR: invalid input syntax for type double precision: "5 . 0" +LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('5 . 0'); + ^ +INSERT INTO FLOAT8_TBL(f1) VALUES ('5. 0'); +ERROR: invalid input syntax for type double precision: "5. 0" +LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('5. 0'); + ^ +INSERT INTO FLOAT8_TBL(f1) VALUES (' - 3'); +ERROR: invalid input syntax for type double precision: " - 3" +LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES (' - 3'); + ^ +INSERT INTO FLOAT8_TBL(f1) VALUES ('123 5'); +ERROR: invalid input syntax for type double precision: "123 5" +LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('123 5'); + ^ +-- special inputs +SELECT 'NaN'::float8; + float8 +-------- + NaN +(1 row) + +SELECT 'nan'::float8; + float8 +-------- + NaN +(1 row) + +SELECT ' NAN '::float8; + float8 +-------- + NaN +(1 row) + +SELECT 'infinity'::float8; + float8 +---------- + Infinity +(1 row) + +SELECT ' -INFINiTY '::float8; + float8 +----------- + -Infinity +(1 row) + +-- bad special inputs +SELECT 'N A N'::float8; +ERROR: invalid input syntax for type double precision: "N A N" +LINE 1: SELECT 'N A N'::float8; + ^ +SELECT 'NaN x'::float8; +ERROR: invalid input syntax for type double precision: "NaN x" +LINE 1: SELECT 'NaN x'::float8; + ^ +SELECT ' INFINITY x'::float8; +ERROR: invalid input syntax for type double precision: " INFINITY x" +LINE 1: SELECT ' INFINITY x'::float8; + ^ +SELECT 'Infinity'::float8 + 100.0; + ?column? +---------- + Infinity +(1 row) + +SELECT 'Infinity'::float8 / 'Infinity'::float8; + ?column? +---------- + NaN +(1 row) + +SELECT 'nan'::float8 / 'nan'::float8; + ?column? +---------- + NaN +(1 row) + +SELECT 'nan'::numeric::float8; + float8 +-------- + NaN +(1 row) + +SELECT '' AS five, * FROM FLOAT8_TBL ORDER BY f1; + five | f1 +------+---------------------- + | -34.84 + | 0 + | 1.2345678901234e-200 + | 1004.3 + | 1.2345678901234e+200 +(5 rows) + +SELECT '' AS four, f.* FROM FLOAT8_TBL f WHERE f.f1 <> '1004.3' ORDER BY f1; + four | f1 +------+---------------------- + | -34.84 + | 0 + | 1.2345678901234e-200 + | 1.2345678901234e+200 +(4 rows) + +SELECT '' AS one, f.* FROM FLOAT8_TBL f WHERE f.f1 = '1004.3'; + one | f1 +-----+-------- + | 1004.3 +(1 row) + +SELECT '' AS three, f.* FROM FLOAT8_TBL f WHERE '1004.3' > f.f1 ORDER BY f1; + three | f1 +-------+---------------------- + | -34.84 + | 0 + | 1.2345678901234e-200 +(3 rows) + +SELECT '' AS three, f.* FROM FLOAT8_TBL f WHERE f.f1 < '1004.3' ORDER BY f1; + three | f1 +-------+---------------------- + | -34.84 + | 0 + | 1.2345678901234e-200 +(3 rows) + +SELECT '' AS four, f.* FROM FLOAT8_TBL f WHERE '1004.3' >= f.f1 ORDER BY f1; + four | f1 +------+---------------------- + | -34.84 + | 0 + | 1.2345678901234e-200 + | 1004.3 +(4 rows) + +SELECT '' AS four, f.* FROM FLOAT8_TBL f WHERE f.f1 <= '1004.3' ORDER BY f1; + four | f1 +------+---------------------- + | -34.84 + | 0 + | 1.2345678901234e-200 + | 1004.3 +(4 rows) + +SELECT '' AS three, f.f1, f.f1 * '-10' AS x + FROM FLOAT8_TBL f + WHERE f.f1 > '0.0' ORDER BY f1; + three | f1 | x +-------+----------------------+----------------------- + | 1.2345678901234e-200 | -1.2345678901234e-199 + | 1004.3 | -10043 + | 1.2345678901234e+200 | -1.2345678901234e+201 +(3 rows) + +SELECT '' AS three, f.f1, f.f1 + '-10' AS x + FROM FLOAT8_TBL f + WHERE f.f1 > '0.0' ORDER BY f1; + three | f1 | x +-------+----------------------+---------------------- + | 1.2345678901234e-200 | -10 + | 1004.3 | 994.3 + | 1.2345678901234e+200 | 1.2345678901234e+200 +(3 rows) + +SELECT '' AS three, f.f1, f.f1 / '-10' AS x + FROM FLOAT8_TBL f + WHERE f.f1 > '0.0' ORDER BY f1; + three | f1 | x +-------+----------------------+----------------------- + | 1.2345678901234e-200 | -1.2345678901234e-201 + | 1004.3 | -100.43 + | 1.2345678901234e+200 | -1.2345678901234e+199 +(3 rows) + +SELECT '' AS three, f.f1, f.f1 - '-10' AS x + FROM FLOAT8_TBL f + WHERE f.f1 > '0.0' ORDER BY f1; + three | f1 | x +-------+----------------------+---------------------- + | 1.2345678901234e-200 | 10 + | 1004.3 | 1014.3 + | 1.2345678901234e+200 | 1.2345678901234e+200 +(3 rows) + +SELECT '' AS one, f.f1 ^ '2.0' AS square_f1 + FROM FLOAT8_TBL f where f.f1 = '1004.3'; + one | square_f1 +-----+------------ + | 1008618.49 +(1 row) + +-- absolute value +SELECT '' AS five, f.f1, @f.f1 AS abs_f1 + FROM FLOAT8_TBL f ORDER BY f1; + five | f1 | abs_f1 +------+----------------------+---------------------- + | -34.84 | 34.84 + | 0 | 0 + | 1.2345678901234e-200 | 1.2345678901234e-200 + | 1004.3 | 1004.3 + | 1.2345678901234e+200 | 1.2345678901234e+200 +(5 rows) + +-- truncate +SELECT '' AS five, f.f1, trunc(f.f1) AS trunc_f1 + FROM FLOAT8_TBL f ORDER BY f1; + five | f1 | trunc_f1 +------+----------------------+---------------------- + | -34.84 | -34 + | 0 | 0 + | 1.2345678901234e-200 | 0 + | 1004.3 | 1004 + | 1.2345678901234e+200 | 1.2345678901234e+200 +(5 rows) + +-- round +SELECT '' AS five, f.f1, round(f.f1) AS round_f1 + FROM FLOAT8_TBL f ORDER BY f1; + five | f1 | round_f1 +------+----------------------+---------------------- + | -34.84 | -35 + | 0 | 0 + | 1.2345678901234e-200 | 0 + | 1004.3 | 1004 + | 1.2345678901234e+200 | 1.2345678901234e+200 +(5 rows) + +-- ceil / ceiling +select ceil(f1) as ceil_f1 from float8_tbl f ORDER BY f1; + ceil_f1 +---------------------- + -34 + 0 + 1 + 1005 + 1.2345678901234e+200 +(5 rows) + +select ceiling(f1) as ceiling_f1 from float8_tbl f ORDER BY f1; + ceiling_f1 +---------------------- + -34 + 0 + 1 + 1005 + 1.2345678901234e+200 +(5 rows) + +-- floor +select floor(f1) as floor_f1 from float8_tbl f ORDER BY f1; + floor_f1 +---------------------- + -35 + 0 + 0 + 1004 + 1.2345678901234e+200 +(5 rows) + +-- sign +select sign(f1) as sign_f1 from float8_tbl f ORDER BY f1; + sign_f1 +--------- + -1 + 0 + 1 + 1 + 1 +(5 rows) + +-- square root +SELECT sqrt(float8 '64') AS eight; + eight +------- + 8 +(1 row) + +SELECT |/ float8 '64' AS eight; + eight +------- + 8 +(1 row) + +SELECT '' AS three, f.f1, |/f.f1 AS sqrt_f1 + FROM FLOAT8_TBL f + WHERE f.f1 > '0.0' ORDER BY f1; + three | f1 | sqrt_f1 +-------+----------------------+----------------------- + | 1.2345678901234e-200 | 1.11111110611109e-100 + | 1004.3 | 31.6906926399535 + | 1.2345678901234e+200 | 1.11111110611109e+100 +(3 rows) + +-- power +SELECT power(float8 '144', float8 '0.5'); + power +------- + 12 +(1 row) + +-- take exp of ln(f.f1) +SELECT '' AS three, f.f1, exp(ln(f.f1)) AS exp_ln_f1 + FROM FLOAT8_TBL f + WHERE f.f1 > '0.0' ORDER BY f1; + three | f1 | exp_ln_f1 +-------+----------------------+----------------------- + | 1.2345678901234e-200 | 1.23456789012339e-200 + | 1004.3 | 1004.3 + | 1.2345678901234e+200 | 1.23456789012338e+200 +(3 rows) + +-- cube root +SELECT ||/ float8 '27' AS three; + three +------- + 3 +(1 row) + +SELECT '' AS five, f.f1, ||/f.f1 AS cbrt_f1 FROM FLOAT8_TBL f ORDER BY f1; + five | f1 | cbrt_f1 +------+----------------------+---------------------- + | -34.84 | -3.26607421344208 + | 0 | 0 + | 1.2345678901234e-200 | 2.3112042409018e-67 + | 1004.3 | 10.014312837827 + | 1.2345678901234e+200 | 4.97933859234765e+66 +(5 rows) + +SELECT '' AS five, * FROM FLOAT8_TBL ORDER BY f1; + five | f1 +------+---------------------- + | -34.84 + | 0 + | 1.2345678901234e-200 + | 1004.3 + | 1.2345678901234e+200 +(5 rows) + +UPDATE FLOAT8_TBL + SET f1 = FLOAT8_TBL.f1 * '-1' + WHERE FLOAT8_TBL.f1 > '0.0'; + +SELECT '' AS bad, f.f1 * '1e200' from FLOAT8_TBL f ORDER BY f1; +ERROR: value out of range: overflow +SELECT '' AS bad, f.f1 ^ '1e200' from FLOAT8_TBL f ORDER BY f1; +ERROR: value out of range: overflow +SELECT 0 ^ 0 + 0 ^ 1 + 0 ^ 0.0 + 0 ^ 0.5; + ?column? +---------- + 2 +(1 row) + +SELECT '' AS bad, ln(f.f1) from FLOAT8_TBL f where f.f1 = '0.0' ; +ERROR: cannot take logarithm of zero +SELECT '' AS bad, ln(f.f1) from FLOAT8_TBL f where f.f1 < '0.0'; +ERROR: cannot take logarithm of a negative number +SELECT '' AS bad, exp(f.f1) from FLOAT8_TBL f ORDER BY f1; +ERROR: value out of range: underflow +SELECT '' AS bad, f.f1 / '0.0' from FLOAT8_TBL f; +ERROR: division by zero +SELECT '' AS five, * FROM FLOAT8_TBL ORDER BY f1; + five | f1 +------+----------------------- + | -1.2345678901234e+200 + | -1004.3 + | -34.84 + | -1.2345678901234e-200 + | 0 +(5 rows) + +-- test for over- and underflow +INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400'); +ERROR: "10e400" is out of range for type double precision +LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400'); + ^ +INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400'); +ERROR: "-10e400" is out of range for type double precision +LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400'); + ^ +INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400'); +ERROR: "10e-400" is out of range for type double precision +LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400'); + ^ +INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400'); +ERROR: "-10e-400" is out of range for type double precision +LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400'); + ^ +-- maintain external table consistency across platforms +-- delete all values and reinsert well-behaved ones +DELETE FROM FLOAT8_TBL; +INSERT INTO FLOAT8_TBL(f1) VALUES ('0.0'); +INSERT INTO FLOAT8_TBL(f1) VALUES ('-34.84'); +INSERT INTO FLOAT8_TBL(f1) VALUES ('-1004.30'); +INSERT INTO FLOAT8_TBL(f1) VALUES ('-1.2345678901234e+200'); +INSERT INTO FLOAT8_TBL(f1) VALUES ('-1.2345678901234e-200'); +SELECT '' AS five, * FROM FLOAT8_TBL ORDER BY f1; + five | f1 +------+----------------------- + | -1.2345678901234e+200 + | -1004.3 + | -34.84 + | -1.2345678901234e-200 + | 0 +(5 rows) + commit fa1747011efd3841353894a0500e31411b4f4efa Author: Michael P <mic...@us...> Date: Tue Mar 8 09:56:59 2011 +0900 Fix for regression tests float4 diff --git a/src/test/regress/sql/float4.sql b/src/test/regress/sql/float4.sql index 12ad660..2b42187 100644 --- a/src/test/regress/sql/float4.sql +++ b/src/test/regress/sql/float4.sql @@ -42,8 +42,6 @@ SELECT 'Infinity'::float4 / 'Infinity'::float4; SELECT 'nan'::float4 / 'nan'::float4; SELECT 'nan'::numeric::float4; -SELECT '' AS five, * FROM FLOAT4_TBL; - SELECT '' AS five, * FROM FLOAT4_TBL ORDER BY f1; SELECT '' AS four, f.* FROM FLOAT4_TBL f WHERE f.f1 <> '1004.3' ORDER BY f1; commit 637f46cda04fee2d9d4bd78c1c9f4f07373aece5 Author: Michael P <mic...@us...> Date: Tue Mar 8 09:50:05 2011 +0900 Fix regression tests for int4 diff --git a/src/test/regress/expected/int4_1.out b/src/test/regress/expected/int4_1.out new file mode 100644 index 0000000..d733e90 --- /dev/null +++ b/src/test/regress/expected/int4_1.out @@ -0,0 +1,333 @@ +-- +-- INT4 +-- WARNING: int4 operators never check for over/underflow! +-- Some of these answers are consequently numerically incorrect. +-- +CREATE TABLE INT4_TBL(f1 int4); +INSERT INTO INT4_TBL(f1) VALUES (' 0 '); +INSERT INTO INT4_TBL(f1) VALUES ('123456 '); +INSERT INTO INT4_TBL(f1) VALUES (' -123456'); +INSERT INTO INT4_TBL(f1) VALUES ('34.5'); +ERROR: invalid input syntax for integer: "34.5" +LINE 1: INSERT INTO INT4_TBL(f1) VALUES ('34.5'); + ^ +-- largest and smallest values +INSERT INTO INT4_TBL(f1) VALUES ('2147483647'); +INSERT INTO INT4_TBL(f1) VALUES ('-2147483647'); +-- bad input values -- should give errors +INSERT INTO INT4_TBL(f1) VALUES ('1000000000000'); +ERROR: value "1000000000000" is out of range for type integer +LINE 1: INSERT INTO INT4_TBL(f1) VALUES ('1000000000000'); + ^ +INSERT INTO INT4_TBL(f1) VALUES ('asdf'); +ERROR: invalid input syntax for integer: "asdf" +LINE 1: INSERT INTO INT4_TBL(f1) VALUES ('asdf'); + ^ +INSERT INTO INT4_TBL(f1) VALUES (' '); +ERROR: invalid input syntax for integer: " " +LINE 1: INSERT INTO INT4_TBL(f1) VALUES (' '); + ^ +INSERT INTO INT4_TBL(f1) VALUES (' asdf '); +ERROR: invalid input syntax for integer: " asdf " +LINE 1: INSERT INTO INT4_TBL(f1) VALUES (' asdf '); + ^ +INSERT INTO INT4_TBL(f1) VALUES ('- 1234'); +ERROR: invalid input syntax for integer: "- 1234" +LINE 1: INSERT INTO INT4_TBL(f1) VALUES ('- 1234'); + ^ +INSERT INTO INT4_TBL(f1) VALUES ('123 5'); +ERROR: invalid input syntax for integer: "123 5" +LINE 1: INSERT INTO INT4_TBL(f1) VALUES ('123 5'); + ^ +INSERT INTO INT4_TBL(f1) VALUES (''); +ERROR: invalid input syntax for integer: "" +LINE 1: INSERT INTO INT4_TBL(f1) VALUES (''); + ^ +SELECT '' AS five, * FROM INT4_TBL ORDER BY f1; + five | f1 +------+------------- + | -2147483647 + | -123456 + | 0 + | 123456 + | 2147483647 +(5 rows) + +SELECT '' AS four, i.* FROM INT4_TBL i WHERE i.f1 <> int2 '0' ORDER BY f1; + four | f1 +------+------------- + | -2147483647 + | -123456 + | 123456 + | 2147483647 +(4 rows) + +SELECT '' AS four, i.* FROM INT4_TBL i WHERE i.f1 <> int4 '0' ORDER BY f1; + four | f1 +------+------------- + | -2147483647 + | -123456 + | 123456 + | 2147483647 +(4 rows) + +SELECT '' AS one, i.* FROM INT4_TBL i WHERE i.f1 = int2 '0'; + one | f1 +-----+---- + | 0 +(1 row) + +SELECT '' AS one, i.* FROM INT4_TBL i WHERE i.f1 = int4 '0'; + one | f1 +-----+---- + | 0 +(1 row) + +SELECT '' AS two, i.* FROM INT4_TBL i WHERE i.f1 < int2 '0' ORDER BY f1; + two | f1 +-----+------------- + | -2147483647 + | -123456 +(2 rows) + +SELECT '' AS two, i.* FROM INT4_TBL i WHERE i.f1 < int4 '0' ORDER BY f1; + two | f1 +-----+------------- + | -2147483647 + | -123456 +(2 rows) + +SELECT '' AS three, i.* FROM INT4_TBL i WHERE i.f1 <= int2 '0' ORDER BY f1; + three | f1 +-------+------------- + | -2147483647 + | -123456 + | 0 +(3 rows) + +SELECT '' AS three, i.* FROM INT4_TBL i WHERE i.f1 <= int4 '0' ORDER BY f1; + three | f1 +-------+------------- + | -2147483647 + | -123456 + | 0 +(3 rows) + +SELECT '' AS two, i.* FROM INT4_TBL i WHERE i.f1 > int2 '0' ORDER BY f1; + two | f1 +-----+------------ + | 123456 + | 2147483647 +(2 rows) + +SELECT '' AS two, i.* FROM INT4_TBL i WHERE i.f1 > int4 '0' ORDER BY f1; + two | f1 +-----+------------ + | 123456 + | 2147483647 +(2 rows) + +SELECT '' AS three, i.* FROM INT4_TBL i WHERE i.f1 >= int2 '0' ORDER BY f1; + three | f1 +-------+------------ + | 0 + | 123456 + | 2147483647 +(3 rows) + +SELECT '' AS three, i.* FROM INT4_TBL i WHERE i.f1 >= int4 '0' ORDER BY f1; + three | f1 +-------+------------ + | 0 + | 123456 + | 2147483647 +(3 rows) + +-- positive odds +SELECT '' AS one, i.* FROM INT4_TBL i WHERE (i.f1 % int2 '2') = int2 '1' ORDER BY f1; + one | f1 +-----+------------ + | 2147483647 +(1 row) + +-- any evens +SELECT '' AS three, i.* FROM INT4_TBL i WHERE (i.f1 % int4 '2') = int2 '0' ORDER BY f1; + three | f1 +-------+--------- + | -123456 + | 0 + | 123456 +(3 rows) + +SELECT '' AS five, i.f1, i.f1 * int2 '2' AS x FROM INT4_TBL i ORDER BY f1; +ERROR: integer out of range +SELECT '' AS five, i.f1, i.f1 * int2 '2' AS x FROM INT4_TBL i +WHERE abs(f1) < 1073741824 ORDER BY f1; + five | f1 | x +------+---------+--------- + | -123456 | -246912 + | 0 | 0 + | 123456 | 246912 +(3 rows) + +SELECT '' AS five, i.f1, i.f1 * int4 '2' AS x FROM INT4_TBL i ORDER BY f1; +ERROR: integer out of range +SELECT '' AS five, i.f1, i.f1 * int4 '2' AS x FROM INT4_TBL i +WHERE abs(f1) < 1073741824 ORDER BY f1; + five | f1 | x +------+---------+--------- + | -123456 | -246912 + | 0 | 0 + | 123456 | 246912 +(3 rows) + +SELECT '' AS five, i.f1, i.f1 + int2 '2' AS x FROM INT4_TBL i ORDER BY f1; +ERROR: integer out of range +SELECT '' AS five, i.f1, i.f1 + int2 '2' AS x FROM INT4_TBL i +WHERE f1 < 2147483646 ORDER BY f1; + five | f1 | x +------+-------------+------------- + | -2147483647 | -2147483645 + | -123456 | -123454 + | 0 | 2 + | 123456 | 123458 +(4 rows) + +SELECT '' AS five, i.f1, i.f1 + int4 '2' AS x FROM INT4_TBL i ORDER BY f1; +ERROR: integer out of range +SELECT '' AS five, i.f1, i.f1 + int4 '2' AS x FROM INT4_TBL i +WHERE f1 < 2147483646 ORDER BY f1; + five | f1 | x +------+-------------+------------- + | -2147483647 | -2147483645 + | -123456 | -123454 + | 0 | 2 + | 123456 | 123458 +(4 rows) + +SELECT '' AS five, i.f1, i.f1 - int2 '2' AS x FROM INT4_TBL i ORDER BY f1; +ERROR: integer out of range +SELECT '' AS five, i.f1, i.f1 - int2 '2' AS x FROM INT4_TBL i +WHERE f1 > -2147483647 ORDER BY f1; + five | f1 | x +------+------------+------------ + | -123456 | -123458 + | 0 | -2 + | 123456 | 123454 + | 2147483647 | 2147483645 +(4 rows) + +SELECT '' AS five, i.f1, i.f1 - int4 '2' AS x FROM INT4_TBL i ORDER BY f1; +ERROR: integer out of range +SELECT '' AS five, i.f1, i.f1 - int4 '2' AS x FROM INT4_TBL i +WHERE f1 > -2147483647 ORDER BY f1; + five | f1 | x +------+------------+------------ + | -123456 | -123458 + | 0 | -2 + | 123456 | 123454 + | 2147483647 | 2147483645 +(4 rows) + +SELECT '' AS five, i.f1, i.f1 / int2 '2' AS x FROM INT4_TBL i ORDER BY f1; + five | f1 | x +------+-------------+------------- + | -2147483647 | -1073741823 + | -123456 | -61728 + | 0 | 0 + | 123456 | 61728 + | 2147483647 | 1073741823 +(5 rows) + +SELECT '' AS five, i.f1, i.f1 / int4 '2' AS x FROM INT4_TBL i ORDER BY f1; + five | f1 | x +------+-------------+------------- + | -2147483647 | -1073741823 + | -123456 | -61728 + | 0 | 0 + | 123456 | 61728 + | 2147483647 | 1073741823 +(5 rows) + +-- +-- more complex expressions +-- +-- variations on unary minus parsing +SELECT -2+3 AS one; + one +----- + 1 +(1 row) + +SELECT 4-2 AS two; + two +----- + 2 +(1 row) + +SELECT 2- -1 AS three; + three +------- + 3 +(1 row) + +SELECT 2 - -2 AS four; + four +------ + 4 +(1 row) + +SELECT int2 '2' * int2 '2' = int2 '16' / int2 '4' AS true; + true +------ + t +(1 row) + +SELECT int4 '2' * int2 '2' = int2 '16' / int4 '4' AS true; + true +------ + t +(1 row) + +SELECT int2 '2' * int4 '2' = int4 '16' / int2 '4' AS true; + true +------ + t +(1 row) + +SELECT int4 '1000' < int4 '999' AS false; + false +------- + f +(1 row) + +SELECT 4! AS twenty_four; + twenty_four +------------- + 24 +(1 row) + +SELECT !!3 AS six; + six +----- + 6 +(1 row) + +SELECT 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 AS ten; + ten +----- + 10 +(1 row) + +SELECT 2 + 2 / 2 AS three; + three +------- + 3 +(1 row) + +SELECT (2 + 2) / 2 AS two; + two +----- + 2 +(1 row) + diff --git a/src/test/regress/sql/int4.sql b/src/test/regress/sql/int4.sql index 53104a0..71dd6f7 100644 --- a/src/test/regress/sql/int4.sql +++ b/src/test/regress/sql/int4.sql @@ -29,7 +29,7 @@ INSERT INTO INT4_TBL(f1) VALUES ('123 5'); INSERT INTO INT4_TBL(f1) VALUES (''); -SELECT '' AS five, * FROM INT4_TBL; +SELECT '' AS five, * FROM INT4_TBL ORDER BY f1; SELECT '' AS four, i.* FROM INT4_TBL i WHERE i.f1 <> int2 '0' ORDER BY f1; commit 405874a1f0d9b6634349bcee5165cd7e305ba81a Author: Michael P <mic...@us...> Date: Tue Mar 8 09:34:35 2011 +0900 Addition of correct output for regress test float4. The only difference between the new file and the former float4.out is that a former query of float4 test that has been modified for XC purposes by adding an ORDER BY was still in the results. diff --git a/src/test/regress/expected/float4_1.out b/src/test/regress/expected/float4_1.out new file mode 100644 index 0000000..432d159 --- /dev/null +++ b/src/test/regress/expected/float4_1.out @@ -0,0 +1,269 @@ +-- +-- FLOAT4 +-- +CREATE TABLE FLOAT4_TBL (f1 float4); +INSERT INTO FLOAT4_TBL(f1) VALUES (' 0.0'); +INSERT INTO FLOAT4_TBL(f1) VALUES ('1004.30 '); +INSERT INTO FLOAT4_TBL(f1) VALUES (' -34.84 '); +INSERT INTO FLOAT4_TBL(f1) VALUES ('1.2345678901234e+20'); +INSERT INTO FLOAT4_TBL(f1) VALUES ('1.2345678901234e-20'); +-- test for over and under flow +INSERT INTO FLOAT4_TBL(f1) VALUES ('10e70'); +ERROR: value out of range: overflow +LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('10e70'); + ^ +INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e70'); +ERROR: value out of range: overflow +LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e70'); + ^ +INSERT INTO FLOAT4_TBL(f1) VALUES ('10e-70'); +ERROR: value out of range: underflow +LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('10e-70'); + ^ +INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e-70'); +ERROR: value out of range: underflow +LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e-70'); + ^ +-- bad input +INSERT INTO FLOAT4_TBL(f1) VALUES (''); +ERROR: invalid input syntax for type real: "" +LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES (''); + ^ +INSERT INTO FLOAT4_TBL(f1) VALUES (' '); +ERROR: invalid input syntax for type real: " " +LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES (' '); + ^ +INSERT INTO FLOAT4_TBL(f1) VALUES ('xyz'); +ERROR: invalid input syntax for type real: "xyz" +LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('xyz'); + ^ +INSERT INTO FLOAT4_TBL(f1) VALUES ('5.0.0'); +ERROR: invalid input syntax for type real: "5.0.0" +LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('5.0.0'); + ^ +INSERT INTO FLOAT4_TBL(f1) VALUES ('5 . 0'); +ERROR: invalid input syntax for type real: "5 . 0" +LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('5 . 0'); + ^ +INSERT INTO FLOAT4_TBL(f1) VALUES ('5. 0'); +ERROR: invalid input syntax for type real: "5. 0" +LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('5. 0'); + ^ +INSERT INTO FLOAT4_TBL(f1) VALUES (' - 3.0'); +ERROR: invalid input syntax for type real: " - 3.0" +LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES (' - 3.0'); + ^ +INSERT INTO FLOAT4_TBL(f1) VALUES ('123 5'); +ERROR: invalid input syntax for type real: "123 5" +LINE 1: INSERT INTO FLOAT4_TBL(f1) VALUES ('123 5'); + ^ +-- special inputs +SELECT 'NaN'::float4; + float4 +-------- + NaN +(1 row) + +SELECT 'nan'::float4; + float4 +-------- + NaN +(1 row) + +SELECT ' NAN '::float4; + float4 +-------- + NaN +(1 row) + +SELECT 'infinity'::float4; + float4 +---------- + Infinity +(1 row) + +SELECT ' -INFINiTY '::float4; + float4 +----------- + -Infinity +(1 row) + +-- bad special inputs +SELECT 'N A N'::float4; +ERROR: invalid input syntax for type real: "N A N" +LINE 1: SELECT 'N A N'::float4; + ^ +SELECT 'NaN x'::float4; +ERROR: invalid input syntax for type real: "NaN x" +LINE 1: SELECT 'NaN x'::float4; + ^ +SELECT ' INFINITY x'::float4; +ERROR: invalid input syntax for type real: " INFINITY x" +LINE 1: SELECT ' INFINITY x'::float4; + ^ +SELECT 'Infinity'::float4 + 100.0; + ?column? +---------- + Infinity +(1 row) + +SELECT 'Infinity'::float4 / 'Infinity'::float4; + ?column? +---------- + NaN +(1 row) + +SELECT 'nan'::float4 / 'nan'::float4; + ?column? +---------- + NaN +(1 row) + +SELECT 'nan'::numeric::float4; + float4 +-------- + NaN +(1 row) + +SELECT '' AS five, * FROM FLOAT4_TBL; + five | f1 +------+------------- + | 1004.3 + | 1.23457e+20 + | 0 + | -34.84 + | 1.23457e-20 +(5 rows) + +SELECT '' AS five, * FROM FLOAT4_TBL ORDER BY f1; + five | f1 +------+------------- + | -34.84 + | 0 + | 1.23457e-20 + | 1004.3 + | 1.23457e+20 +(5 rows) + +SELECT '' AS four, f.* FROM FLOAT4_TBL f WHERE f.f1 <> '1004.3' ORDER BY f1; + four | f1 +------+------------- + | -34.84 + | 0 + | 1.23457e-20 + | 1.23457e+20 +(4 rows) + +SELECT '' AS one, f.* FROM FLOAT4_TBL f WHERE f.f1 = '1004.3'; + one | f1 +-----+-------- + | 1004.3 +(1 row) + +SELECT '' AS three, f.* FROM FLOAT4_TBL f WHERE '1004.3' > f.f1 ORDER BY f1; + three | f1 +-------+------------- + | -34.84 + | 0 + | 1.23457e-20 +(3 rows) + +SELECT '' AS three, f.* FROM FLOAT4_TBL f WHERE f.f1 < '1004.3' ORDER BY f1; + three | f1 +-------+------------- + | -34.84 + | 0 + | 1.23457e-20 +(3 rows) + +SELECT '' AS four, f.* FROM FLOAT4_TBL f WHERE '1004.3' >= f.f1 ORDER BY f1; + four | f1 +------+------------- + | -34.84 + | 0 + | 1.23457e-20 + | 1004.3 +(4 rows) + +SELECT '' AS four, f.* FROM FLOAT4_TBL f WHERE f.f1 <= '1004.3' ORDER BY f1; + four | f1 +------+------------- + | -34.84 + | 0 + | 1.23457e-20 + | 1004.3 +(4 rows) + +SELECT '' AS three, f.f1, f.f1 * '-10' AS x FROM FLOAT4_TBL f + WHERE f.f1 > '0.0' ORDER BY f1; + three | f1 | x +-------+-------------+-------------- + | 1.23457e-20 | -1.23457e-19 + | 1004.3 | -10043 + | 1.23457e+20 | -1.23457e+21 +(3 rows) + +SELECT '' AS three, f.f1, f.f1 + '-10' AS x FROM FLOAT4_TBL f + WHERE f.f1 > '0.0' ORDER BY f1; + three | f1 | x +-------+-------------+------------- + | 1.23457e-20 | -10 + | 1004.3 | 994.3 + | 1.23457e+20 | 1.23457e+20 +(3 rows) + +SELECT '' AS three, f.f1, f.f1 / '-10' AS x FROM FLOAT4_TBL f + WHERE f.f1 > '0.0' ORDER BY f1; + three | f1 | x +-------+-------------+-------------- + | 1.23457e-20 | -1.23457e-21 + | 1004.3 | -100.43 + | 1.23457e+20 | -1.23457e+19 +(3 rows) + +SELECT '' AS three, f.f1, f.f1 - '-10' AS x FROM FLOAT4_TBL f + WHERE f.f1 > '0.0' ORDER BY f1; + three | f1 | x +-------+-------------+------------- + | 1.23457e-20 | 10 + | 1004.3 | 1014.3 + | 1.23457e+20 | 1.23457e+20 +(3 rows) + +-- test divide by zero +SELECT '' AS bad, f.f1 / '0.0' from FLOAT4_TBL f; +ERROR: division by zero +SELECT '' AS five, * FROM FLOAT4_TBL ORDER BY f1; + five | f1 +------+------------- + | -34.84 + | 0 + | 1.23457e-20 + | 1004.3 + | 1.23457e+20 +(5 rows) + +-- test the unary float4abs operator +SELECT '' AS five, f.f1, @f.f1 AS abs_f1 FROM FLOAT4_TBL f ORDER BY f1; + five | f1 | abs_f1 +------+-------------+------------- + | -34.84 | 34.84 + | 0 | 0 + | 1.23457e-20 | 1.23457e-20 + | 1004.3 | 1004.3 + | 1.23457e+20 | 1.23457e+20 +(5 rows) + +UPDATE FLOAT4_TBL + SET f1 = FLOAT4_TBL.f1 * '-1' + WHERE FLOAT4_TBL.f1 > '0.0'; +SELECT '' AS five, * FROM FLOAT4_TBL ORDER BY f1; + five | f1 +------+-------------- + | -1.23457e+20 + | -1004.3 + | -34.84 + | -1.23457e-20 + | 0 +(5 rows) + ----------------------------------------------------------------------- Summary of changes: .../regress/expected/{float4.out => float4_1.out} | 10 ++++++++++ .../regress/expected/{float8.out => float8_1.out} | 9 --------- src/test/regress/expected/{int4.out => int4_1.out} | 6 +++--- src/test/regress/sql/float4.sql | 2 -- src/test/regress/sql/int4.sql | 2 +- 5 files changed, 14 insertions(+), 15 deletions(-) copy src/test/regress/expected/{float4.out => float4_1.out} (97%) copy src/test/regress/expected/{float8.out => float8_1.out} (98%) copy src/test/regress/expected/{int4.out => int4_1.out} (99%) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-03-08 00:07:27
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via 94b048a92d21bd787294cabd3a144cf69badd419 (commit) from acef8b6dde2c598a727e2eaf2cca5b66db0b592f (commit) - Log ----------------------------------------------------------------- commit 94b048a92d21bd787294cabd3a144cf69badd419 Author: Michael P <mic...@us...> Date: Tue Mar 8 09:06:05 2011 +0900 Change back table defalt type to distributed. This is done for performance purposes. diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c index ea20e66..4737067 100644 --- a/src/backend/catalog/heap.c +++ b/src/backend/catalog/heap.c @@ -879,9 +879,28 @@ AddRelationDistribution (Oid relid, { /* * If no distribution was specified, and we have not chosen - * distribute table by replication. + * one based on primary key or foreign key, use first column with + * a supported data type. */ - locatortype = LOCATOR_TYPE_REPLICATED; + Form_pg_attribute attr; + int i; + + locatortype = LOCATOR_TYPE_HASH; + + for (i = 0; i < descriptor->natts; i++) + { + attr = descriptor->attrs[i]; + if (IsHashDistributable(attr->atttypid)) + { + /* distribute on this column */ + attnum = i + 1; + break; + } + } + + /* If we did not find a usable type, fall back to round robin */ + if (attnum == 0) + locatortype = LOCATOR_TYPE_RROBIN; } } else ----------------------------------------------------------------------- Summary of changes: src/backend/catalog/heap.c | 23 +++++++++++++++++++++-- 1 files changed, 21 insertions(+), 2 deletions(-) hooks/post-receive -- Postgres-XC |
From: Abbas B. <ga...@us...> - 2011-03-07 17:11:47
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via acef8b6dde2c598a727e2eaf2cca5b66db0b592f (commit) from df5e5dc0ea901385e7be446ca6d9ebec7e58cb12 (commit) - Log ----------------------------------------------------------------- commit acef8b6dde2c598a727e2eaf2cca5b66db0b592f Author: Abbas <abb...@en...> Date: Mon Mar 7 22:11:14 2011 +0500 To fix a server crash in aggregates as reported in ID 3125430 diff --git a/src/backend/pgxc/pool/execRemote.c b/src/backend/pgxc/pool/execRemote.c index 8a553d4..af2f80c 100644 --- a/src/backend/pgxc/pool/execRemote.c +++ b/src/backend/pgxc/pool/execRemote.c @@ -3550,7 +3550,6 @@ ExecRemoteQuery(RemoteQueryState *node) TupleTableSlot *scanslot = node->ss.ss_ScanTupleSlot; bool have_tuple = false; - if (!node->query_Done) { /* @@ -3677,7 +3676,22 @@ handle_results: */ if (node->simple_aggregates) { + int i, natts; + finish_simple_aggregates(node, resultslot); + + /* + * PGXCTODO :In fact exec_simple_aggregates & finish_simple_aggregates + * should not be resulting in a TupleTableSlot with NULL pointer in + * per attribute value, but for now to fix the crash this check would do + */ + natts = resultslot->tts_tupleDescriptor->natts; + for (i = 0; i < natts; ++i) + { + if (resultslot->tts_values[i] == NULL) + return NULL; + } + if (!TupIsNull(resultslot)) have_tuple = true; } ----------------------------------------------------------------------- Summary of changes: src/backend/pgxc/pool/execRemote.c | 16 +++++++++++++++- 1 files changed, 15 insertions(+), 1 deletions(-) hooks/post-receive -- Postgres-XC |
From: Abbas B. <ga...@us...> - 2011-03-07 15:01:22
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via df5e5dc0ea901385e7be446ca6d9ebec7e58cb12 (commit) from 93781551114d9fe5826459caaf8aa03d63bac001 (commit) - Log ----------------------------------------------------------------- commit df5e5dc0ea901385e7be446ca6d9ebec7e58cb12 Author: Abbas <abb...@en...> Date: Mon Mar 7 20:00:38 2011 +0500 To avoid a crash caused by an insert select statement in vacuum.sql diff --git a/src/backend/pgxc/plan/planner.c b/src/backend/pgxc/plan/planner.c index d3aaaa4..378d9b4 100644 --- a/src/backend/pgxc/plan/planner.c +++ b/src/backend/pgxc/plan/planner.c @@ -603,9 +603,14 @@ get_plan_nodes_insert(PlannerInfo *root, RemoteQuery *step) (errcode(ERRCODE_STATEMENT_TOO_COMPLEX), (errmsg("Could not find relation for oid = %d", rte->relid)))); - if ((strcmp(col_base->colname, source_rel_loc_info->partAttrName) == 0) && - ( (source_rel_loc_info->locatorType == LOCATOR_TYPE_HASH) || - (source_rel_loc_info->locatorType == LOCATOR_TYPE_MODULO) )) + if ( col_base->colname != NULL && + source_rel_loc_info->partAttrName != NULL && + strcmp(col_base->colname, source_rel_loc_info->partAttrName) == 0 && + ( + source_rel_loc_info->locatorType == LOCATOR_TYPE_HASH || + source_rel_loc_info->locatorType == LOCATOR_TYPE_MODULO + ) + ) { /* * Partition columns match, we have a "single-step INSERT SELECT". ----------------------------------------------------------------------- Summary of changes: src/backend/pgxc/plan/planner.c | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) hooks/post-receive -- Postgres-XC |
From: Abbas B. <ga...@us...> - 2011-03-07 11:25:45
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via 93781551114d9fe5826459caaf8aa03d63bac001 (commit) from fa427af446193741501c72e6e026ac493a125137 (commit) - Log ----------------------------------------------------------------- commit 93781551114d9fe5826459caaf8aa03d63bac001 Author: Abbas <abb...@en...> Date: Mon Mar 7 15:42:27 2011 +0500 Block creation of concurrent indices diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index bf122db..2bb2200 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -1057,6 +1057,16 @@ standard_ProcessUtility(Node *parsetree, { IndexStmt *stmt = (IndexStmt *) parsetree; +#ifdef PGXC + if (stmt->concurrent) + { + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("PGXC does not support concurrent indexes"), + errdetail("The feature is not currently supported"))); + } +#endif + if (stmt->concurrent) PreventTransactionChain(isTopLevel, "CREATE INDEX CONCURRENTLY"); @@ -1087,7 +1097,7 @@ standard_ProcessUtility(Node *parsetree, false, /* quiet */ stmt->concurrent); /* concurrent */ #ifdef PGXC - if (IS_PGXC_COORDINATOR && !stmt->isconstraint) + if (IS_PGXC_COORDINATOR && !stmt->isconstraint && !IsConnFromCoord()) ExecUtilityStmtOnNodes(queryString, NULL, stmt->concurrent, EXEC_ON_ALL_NODES); #endif ----------------------------------------------------------------------- Summary of changes: src/backend/tcop/utility.c | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-03-07 07:15:58
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via fa427af446193741501c72e6e026ac493a125137 (commit) via a6a956e4d1303161750161c0629adb1b4514d345 (commit) via 33342d8d44bb2c36239712d9e7318df0776ce018 (commit) from 9ecde28ad6b6ed00b7588928480bf0bd8a741421 (commit) - Log ----------------------------------------------------------------- commit fa427af446193741501c72e6e026ac493a125137 Author: Michael P <mic...@us...> Date: Mon Mar 7 16:09:54 2011 +0900 CREATE TABLE default distribution to REPLICATED Change distribution type of table to REPLICATED when no distribution is specified like with: CREATE TABLE aa (int a); diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c index 59231a8..ea20e66 100644 --- a/src/backend/catalog/heap.c +++ b/src/backend/catalog/heap.c @@ -874,34 +874,17 @@ AddRelationDistribution (Oid relid, errmsg("Invalid parent table distribution type"))); break; } - } else + } + else { /* * If no distribution was specified, and we have not chosen - * one based on primary key or foreign key, use first column with - * a supported data type. + * distribute table by replication. */ - Form_pg_attribute attr; - int i; - - locatortype = LOCATOR_TYPE_HASH; - - for (i = 0; i < descriptor->natts; i++) - { - attr = descriptor->attrs[i]; - if (IsHashDistributable(attr->atttypid)) - { - /* distribute on this column */ - attnum = i + 1; - break; - } - } - - /* If we did not find a usable type, fall back to round robin */ - if (attnum == 0) - locatortype = LOCATOR_TYPE_RROBIN; + locatortype = LOCATOR_TYPE_REPLICATED; } - } else + } + else { /* * User specified distribution type commit a6a956e4d1303161750161c0629adb1b4514d345 Author: Michael P <mic...@us...> Date: Mon Mar 7 16:00:16 2011 +0900 Block PREPARE and EXECUTE for the time being It has been noticed that PREPARE crashed the server in some pg_regress test cases. diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index 1240614..bf122db 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -804,11 +804,21 @@ standard_ProcessUtility(Node *parsetree, break; case T_PrepareStmt: +#ifdef PGXC + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("PREPARE is not supported"))); +#endif CheckRestrictedOperation("PREPARE"); PrepareQuery((PrepareStmt *) parsetree, queryString); break; case T_ExecuteStmt: +#ifdef PGXC + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("EXECUTE is not supported"))); +#endif ExecuteQuery((ExecuteStmt *) parsetree, queryString, params, dest, completionTag); break; commit 33342d8d44bb2c36239712d9e7318df0776ce018 Author: Michael P <mic...@us...> Date: Mon Mar 7 15:58:13 2011 +0900 Fix for CREATE INDEX CONCURRENTLY When an index is created concurrently, Coordinator tried to take a snapshot that had already been deleted. We need to take a new one from Coordinator. Patch written by Abbas Butt diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c index a735fc3..8140321 100644 --- a/src/backend/utils/time/snapmgr.c +++ b/src/backend/utils/time/snapmgr.c @@ -34,7 +34,9 @@ #include "utils/resowner.h" #include "utils/snapmgr.h" #include "utils/tqual.h" - +#ifdef PGXC +#include "pgxc/pgxc.h" +#endif /* * CurrentSnapshot points to the only snapshot taken in a serializable @@ -344,6 +346,14 @@ PopActiveSnapshot(void) Snapshot GetActiveSnapshot(void) { +#ifdef PGXC + /* + * Check if topmost snapshot is null or not, + * if it is, a new one will be taken from GTM. + */ + if (!ActiveSnapshot && IS_PGXC_COORDINATOR && !IsConnFromCoord()) + return NULL; +#endif Assert(ActiveSnapshot != NULL); return ActiveSnapshot->as_snap; ----------------------------------------------------------------------- Summary of changes: src/backend/catalog/heap.c | 29 ++++++----------------------- src/backend/tcop/utility.c | 10 ++++++++++ src/backend/utils/time/snapmgr.c | 12 +++++++++++- 3 files changed, 27 insertions(+), 24 deletions(-) hooks/post-receive -- Postgres-XC |