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-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 |