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: Michael P. <mic...@us...> - 2011-03-22 17:56:58
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via bcce6a86720fb9ad81aa8ac0d84355aa27654504 (commit) from 0e51d7efa87f0d0011cee8927118080514d96228 (commit) - Log ----------------------------------------------------------------- commit bcce6a86720fb9ad81aa8ac0d84355aa27654504 Author: Michael P <mic...@us...> Date: Wed Mar 23 02:55:52 2011 +0900 Fix for regression test combocid TEMP TABLE is not supported yet by Postgres-XC, so this output is correct. diff --git a/src/test/regress/expected/combocid_1.out b/src/test/regress/expected/combocid_1.out new file mode 100644 index 0000000..eab7085 --- /dev/null +++ b/src/test/regress/expected/combocid_1.out @@ -0,0 +1,120 @@ +-- +-- Tests for some likely failure cases with combo cmin/cmax mechanism +-- +CREATE TEMP TABLE combocidtest (foobar int); +ERROR: PG-XC does not yet support temporary tables +BEGIN; +-- a few dummy ops to push up the CommandId counter +INSERT INTO combocidtest SELECT 1 LIMIT 0; +ERROR: relation "combocidtest" does not exist +LINE 1: INSERT INTO combocidtest SELECT 1 LIMIT 0; + ^ +INSERT INTO combocidtest SELECT 1 LIMIT 0; +ERROR: current transaction is aborted, commands ignored until end of transaction block +INSERT INTO combocidtest SELECT 1 LIMIT 0; +ERROR: current transaction is aborted, commands ignored until end of transaction block +INSERT INTO combocidtest SELECT 1 LIMIT 0; +ERROR: current transaction is aborted, commands ignored until end of transaction block +INSERT INTO combocidtest SELECT 1 LIMIT 0; +ERROR: current transaction is aborted, commands ignored until end of transaction block +INSERT INTO combocidtest SELECT 1 LIMIT 0; +ERROR: current transaction is aborted, commands ignored until end of transaction block +INSERT INTO combocidtest SELECT 1 LIMIT 0; +ERROR: current transaction is aborted, commands ignored until end of transaction block +INSERT INTO combocidtest SELECT 1 LIMIT 0; +ERROR: current transaction is aborted, commands ignored until end of transaction block +INSERT INTO combocidtest SELECT 1 LIMIT 0; +ERROR: current transaction is aborted, commands ignored until end of transaction block +INSERT INTO combocidtest SELECT 1 LIMIT 0; +ERROR: current transaction is aborted, commands ignored until end of transaction block +INSERT INTO combocidtest VALUES (1); +ERROR: current transaction is aborted, commands ignored until end of transaction block +INSERT INTO combocidtest VALUES (2); +ERROR: current transaction is aborted, commands ignored until end of transaction block +SELECT ctid,cmin,* FROM combocidtest ORDER BY ctid; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SAVEPOINT s1; +ERROR: current transaction is aborted, commands ignored until end of transaction block +UPDATE combocidtest SET foobar = foobar + 10; +ERROR: current transaction is aborted, commands ignored until end of transaction block +-- here we should see only updated tuples +SELECT ctid,cmin,* FROM combocidtest ORDER BY ctid; +ERROR: current transaction is aborted, commands ignored until end of transaction block +ROLLBACK TO s1; +ERROR: no such savepoint +-- now we should see old tuples, but with combo CIDs starting at 0 +SELECT ctid,cmin,* FROM combocidtest ORDER BY ctid; +ERROR: current transaction is aborted, commands ignored until end of transaction block +COMMIT; +-- combo data is not there anymore, but should still see tuples +SELECT ctid,cmin,* FROM combocidtest; +ERROR: relation "combocidtest" does not exist +LINE 1: SELECT ctid,cmin,* FROM combocidtest; + ^ +-- Test combo cids with portals +BEGIN; +INSERT INTO combocidtest VALUES (333); +ERROR: relation "combocidtest" does not exist +LINE 1: INSERT INTO combocidtest VALUES (333); + ^ +DECLARE c CURSOR FOR SELECT ctid,cmin,* FROM combocidtest ORDER BY ctid; +ERROR: current transaction is aborted, commands ignored until end of transaction block +DELETE FROM combocidtest; +ERROR: current transaction is aborted, commands ignored until end of transaction block +FETCH ALL FROM c; +ERROR: current transaction is aborted, commands ignored until end of transaction block +ROLLBACK; +SELECT ctid,cmin,* FROM combocidtest ORDER BY ctid; +ERROR: relation "combocidtest" does not exist +LINE 1: SELECT ctid,cmin,* FROM combocidtest ORDER BY ctid; + ^ +-- check behavior with locked tuples +BEGIN; +-- a few dummy ops to push up the CommandId counter +INSERT INTO combocidtest SELECT 1 LIMIT 0; +ERROR: relation "combocidtest" does not exist +LINE 1: INSERT INTO combocidtest SELECT 1 LIMIT 0; + ^ +INSERT INTO combocidtest SELECT 1 LIMIT 0; +ERROR: current transaction is aborted, commands ignored until end of transaction block +INSERT INTO combocidtest SELECT 1 LIMIT 0; +ERROR: current transaction is aborted, commands ignored until end of transaction block +INSERT INTO combocidtest SELECT 1 LIMIT 0; +ERROR: current transaction is aborted, commands ignored until end of transaction block +INSERT INTO combocidtest SELECT 1 LIMIT 0; +ERROR: current transaction is aborted, commands ignored until end of transaction block +INSERT INTO combocidtest SELECT 1 LIMIT 0; +ERROR: current transaction is aborted, commands ignored until end of transaction block +INSERT INTO combocidtest SELECT 1 LIMIT 0; +ERROR: current transaction is aborted, commands ignored until end of transaction block +INSERT INTO combocidtest SELECT 1 LIMIT 0; +ERROR: current transaction is aborted, commands ignored until end of transaction block +INSERT INTO combocidtest SELECT 1 LIMIT 0; +ERROR: current transaction is aborted, commands ignored until end of transaction block +INSERT INTO combocidtest SELECT 1 LIMIT 0; +ERROR: current transaction is aborted, commands ignored until end of transaction block +INSERT INTO combocidtest VALUES (444); +ERROR: current transaction is aborted, commands ignored until end of transaction block +SELECT ctid,cmin,* FROM combocidtest ORDER BY ctid; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SAVEPOINT s1; +ERROR: current transaction is aborted, commands ignored until end of transaction block +-- this doesn't affect cmin +SELECT ctid,cmin,* FROM combocidtest FOR UPDATE; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SELECT ctid,cmin,* FROM combocidtest ORDER BY ctid; +ERROR: current transaction is aborted, commands ignored until end of transaction block +-- but this does +UPDATE combocidtest SET foobar = foobar + 10; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SELECT ctid,cmin,* FROM combocidtest ORDER BY ctid; +ERROR: current transaction is aborted, commands ignored until end of transaction block +ROLLBACK TO s1; +ERROR: no such savepoint +SELECT ctid,cmin,* FROM combocidtest ORDER BY ctid; +ERROR: current transaction is aborted, commands ignored until end of transaction block +COMMIT; +SELECT ctid,cmin,* FROM combocidtest ORDER BY ctid; +ERROR: relation "combocidtest" does not exist +LINE 1: SELECT ctid,cmin,* FROM combocidtest ORDER BY ctid; + ^ ----------------------------------------------------------------------- Summary of changes: src/test/regress/expected/combocid_1.out | 120 ++++++++++++++++++++++++++++++ 1 files changed, 120 insertions(+), 0 deletions(-) create mode 100644 src/test/regress/expected/combocid_1.out hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-03-22 17:51:57
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via 0e51d7efa87f0d0011cee8927118080514d96228 (commit) from 5e0c62f09c4584c9918dca06e5a5770a2e7bd472 (commit) - Log ----------------------------------------------------------------- commit 0e51d7efa87f0d0011cee8927118080514d96228 Author: Michael P <mic...@us...> Date: Wed Mar 23 02:51:01 2011 +0900 Fix for regression test plancache PREPARE, EXECUTE and TEMP TABLE are not yet supported by Postgres-XC, so this output is correct. diff --git a/src/test/regress/expected/plancache_1.out b/src/test/regress/expected/plancache_1.out new file mode 100644 index 0000000..389d0da --- /dev/null +++ b/src/test/regress/expected/plancache_1.out @@ -0,0 +1,209 @@ +-- +-- Tests to exercise the plan caching/invalidation mechanism +-- +CREATE TEMP TABLE pcachetest AS SELECT * FROM int8_tbl; +ERROR: INTO clause not yet supported +-- create and use a cached plan +PREPARE prepstmt AS SELECT * FROM pcachetest ORDER BY q1, q2; +ERROR: Postgres-XC does not support PREPARE yet +DETAIL: The feature is not currently supported +EXECUTE prepstmt; +ERROR: Postgres-XC does not support EXECUTE yet +DETAIL: The feature is not currently supported +-- and one with parameters +PREPARE prepstmt2(bigint) AS SELECT * FROM pcachetest WHERE q1 = $1 ORDER BY q1, q2; +ERROR: Postgres-XC does not support PREPARE yet +DETAIL: The feature is not currently supported +EXECUTE prepstmt2(123); +ERROR: Postgres-XC does not support EXECUTE yet +DETAIL: The feature is not currently supported +-- invalidate the plans and see what happens +DROP TABLE pcachetest; +ERROR: table "pcachetest" does not exist +EXECUTE prepstmt; +ERROR: Postgres-XC does not support EXECUTE yet +DETAIL: The feature is not currently supported +EXECUTE prepstmt2(123); +ERROR: Postgres-XC does not support EXECUTE yet +DETAIL: The feature is not currently supported +-- recreate the temp table (this demonstrates that the raw plan is +-- purely textual and doesn't depend on OIDs, for instance) +CREATE TEMP TABLE pcachetest AS SELECT * FROM int8_tbl ORDER BY q1, q2; +ERROR: INTO clause not yet supported +EXECUTE prepstmt; +ERROR: Postgres-XC does not support EXECUTE yet +DETAIL: The feature is not currently supported +EXECUTE prepstmt2(123); +ERROR: Postgres-XC does not support EXECUTE yet +DETAIL: The feature is not currently supported +-- prepared statements should prevent change in output tupdesc, +-- since clients probably aren't expecting that to change on the fly +ALTER TABLE pcachetest ADD COLUMN q3 bigint; +ERROR: relation "pcachetest" does not exist +EXECUTE prepstmt; +ERROR: Postgres-XC does not support EXECUTE yet +DETAIL: The feature is not currently supported +EXECUTE prepstmt2(123); +ERROR: Postgres-XC does not support EXECUTE yet +DETAIL: The feature is not currently supported +-- but we're nice guys and will let you undo your mistake +ALTER TABLE pcachetest DROP COLUMN q3; +ERROR: relation "pcachetest" does not exist +EXECUTE prepstmt; +ERROR: Postgres-XC does not support EXECUTE yet +DETAIL: The feature is not currently supported +EXECUTE prepstmt2(123); +ERROR: Postgres-XC does not support EXECUTE yet +DETAIL: The feature is not currently supported +-- Try it with a view, which isn't directly used in the resulting plan +-- but should trigger invalidation anyway +CREATE TEMP VIEW pcacheview AS + SELECT * FROM pcachetest; +ERROR: relation "pcachetest" does not exist +LINE 2: SELECT * FROM pcachetest; + ^ +PREPARE vprep AS SELECT * FROM pcacheview ORDER BY q1, q2; +ERROR: Postgres-XC does not support PREPARE yet +DETAIL: The feature is not currently supported +EXECUTE vprep; +ERROR: Postgres-XC does not support EXECUTE yet +DETAIL: The feature is not currently supported +CREATE OR REPLACE TEMP VIEW pcacheview AS + SELECT q1, q2/2 AS q2 FROM pcachetest ORDER BY q1, q2; +ERROR: relation "pcachetest" does not exist +LINE 2: SELECT q1, q2/2 AS q2 FROM pcachetest ORDER BY q1, q2; + ^ +EXECUTE vprep; +ERROR: Postgres-XC does not support EXECUTE yet +DETAIL: The feature is not currently supported +-- Check basic SPI plan invalidation +create function cache_test(int) returns int as $$ +declare total int; +begin + create temp table t1(f1 int); + insert into t1 values($1); + insert into t1 values(11); + insert into t1 values(12); + insert into t1 values(13); + select sum(f1) into total from t1; + drop table t1; + return total; +end +$$ language plpgsql; +select cache_test(1); +ERROR: PG-XC does not yet support temporary tables +CONTEXT: SQL statement "create temp table t1(f1 int)" +PL/pgSQL function "cache_test" line 3 at SQL statement +select cache_test(2); +ERROR: PG-XC does not yet support temporary tables +CONTEXT: SQL statement "create temp table t1(f1 int)" +PL/pgSQL function "cache_test" line 3 at SQL statement +select cache_test(3); +ERROR: PG-XC does not yet support temporary tables +CONTEXT: SQL statement "create temp table t1(f1 int)" +PL/pgSQL function "cache_test" line 3 at SQL statement +-- Check invalidation of plpgsql "simple expression" +create temp view v1 as + select 2+2 as f1; +ERROR: PG-XC does not yet support temporary tables +create function cache_test_2() returns int as $$ +begin + return f1 from v1; +end$$ language plpgsql; +select cache_test_2(); +ERROR: relation "v1" does not exist +LINE 1: SELECT f1 from v1 + ^ +QUERY: SELECT f1 from v1 +CONTEXT: PL/pgSQL function "cache_test_2" line 2 at RETURN +create or replace temp view v1 as + select 2+2+4 as f1; +ERROR: PG-XC does not yet support temporary tables +select cache_test_2(); +ERROR: relation "v1" does not exist +LINE 1: SELECT f1 from v1 + ^ +QUERY: SELECT f1 from v1 +CONTEXT: PL/pgSQL function "cache_test_2" line 2 at RETURN +create or replace temp view v1 as + select 2+2+4+(select max(unique1) from tenk1) as f1; +ERROR: PG-XC does not yet support temporary tables +select cache_test_2(); +ERROR: relation "v1" does not exist +LINE 1: SELECT f1 from v1 + ^ +QUERY: SELECT f1 from v1 +CONTEXT: PL/pgSQL function "cache_test_2" line 2 at RETURN +--- Check that change of search_path is ignored by replans +create schema s1 + create table abc (f1 int); +create schema s2 + create table abc (f1 int); +insert into s1.abc values(123); +insert into s2.abc values(456); +set search_path = s1; +prepare p1 as select f1 from abc; +ERROR: Postgres-XC does not support PREPARE yet +DETAIL: The feature is not currently supported +execute p1; +ERROR: Postgres-XC does not support EXECUTE yet +DETAIL: The feature is not currently supported +set search_path = s2; +select f1 from abc; +ERROR: relation "abc" does not exist +execute p1; +ERROR: Postgres-XC does not support EXECUTE yet +DETAIL: The feature is not currently supported +alter table s1.abc add column f2 float8; -- force replan +execute p1; +ERROR: Postgres-XC does not support EXECUTE yet +DETAIL: The feature is not currently supported +drop schema s1 cascade; +NOTICE: drop cascades to table s1.abc +drop schema s2 cascade; +NOTICE: drop cascades to table abc +reset search_path; +-- Check that invalidation deals with regclass constants +create temp sequence seq; +ERROR: Postgres-XC does not support TEMPORARY SEQUENCE yet +DETAIL: The feature is not currently supported +prepare p2 as select nextval('seq'); +ERROR: Postgres-XC does not support PREPARE yet +DETAIL: The feature is not currently supported +execute p2; +ERROR: Postgres-XC does not support EXECUTE yet +DETAIL: The feature is not currently supported +drop sequence seq; +ERROR: sequence "seq" does not exist +create temp sequence seq; +ERROR: Postgres-XC does not support TEMPORARY SEQUENCE yet +DETAIL: The feature is not currently supported +execute p2; +ERROR: Postgres-XC does not support EXECUTE yet +DETAIL: The feature is not currently supported +-- Check DDL via SPI, immediately followed by SPI plan re-use +-- (bug in original coding) +create function cachebug() returns void as $$ +declare r int; +begin + drop table if exists temptable cascade; + create temp table temptable as select * from generate_series(1,3) as f1; + create temp view vv as select * from temptable; + for r in select * from vv loop + raise notice '%', r; + end loop; +end$$ language plpgsql; +select cachebug(); +NOTICE: table "temptable" does not exist, skipping +CONTEXT: SQL statement "drop table if exists temptable cascade" +PL/pgSQL function "cachebug" line 3 at SQL statement +ERROR: INTO clause not yet supported +CONTEXT: SQL statement "create temp table temptable as select * from generate_series(1,3) as f1" +PL/pgSQL function "cachebug" line 4 at SQL statement +select cachebug(); +NOTICE: table "temptable" does not exist, skipping +CONTEXT: SQL statement "drop table if exists temptable cascade" +PL/pgSQL function "cachebug" line 3 at SQL statement +ERROR: INTO clause not yet supported +CONTEXT: SQL statement "create temp table temptable as select * from generate_series(1,3) as f1" +PL/pgSQL function "cachebug" line 4 at SQL statement ----------------------------------------------------------------------- Summary of changes: src/test/regress/expected/plancache_1.out | 209 +++++++++++++++++++++++++++++ 1 files changed, 209 insertions(+), 0 deletions(-) create mode 100644 src/test/regress/expected/plancache_1.out hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-03-22 17:29:51
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via 5e0c62f09c4584c9918dca06e5a5770a2e7bd472 (commit) from 9265ae6c81b0bf499ab010736125f7ffca812c0e (commit) - Log ----------------------------------------------------------------- commit 5e0c62f09c4584c9918dca06e5a5770a2e7bd472 Author: Michael P <mic...@us...> Date: Wed Mar 23 02:28:19 2011 +0900 Fix for regression test delete SERIAL is not supported yet by XC, so this output is correct. diff --git a/src/test/regress/expected/delete_1.out b/src/test/regress/expected/delete_1.out new file mode 100644 index 0000000..ec6d4a4 --- /dev/null +++ b/src/test/regress/expected/delete_1.out @@ -0,0 +1,37 @@ +CREATE TABLE delete_test ( + id SERIAL PRIMARY KEY, + a INT +); +ERROR: Postgres-XC does not support SERIAL yet +DETAIL: The feature is not currently supported +INSERT INTO delete_test (a) VALUES (10); +ERROR: relation "delete_test" does not exist +LINE 1: INSERT INTO delete_test (a) VALUES (10); + ^ +INSERT INTO delete_test (a) VALUES (50); +ERROR: relation "delete_test" does not exist +LINE 1: INSERT INTO delete_test (a) VALUES (50); + ^ +INSERT INTO delete_test (a) VALUES (100); +ERROR: relation "delete_test" does not exist +LINE 1: INSERT INTO delete_test (a) VALUES (100); + ^ +-- allow an alias to be specified for DELETE's target table +DELETE FROM delete_test AS dt WHERE dt.a > 75; +ERROR: relation "delete_test" does not exist +LINE 1: DELETE FROM delete_test AS dt WHERE dt.a > 75; + ^ +-- if an alias is specified, don't allow the original table name +-- to be referenced +DELETE FROM delete_test dt WHERE delete_test.a > 25; +ERROR: relation "delete_test" does not exist +LINE 1: DELETE FROM delete_test dt WHERE delete_test.a > 25; + ^ +SELECT * FROM delete_test; +ERROR: relation "delete_test" does not exist +LINE 1: SELECT * FROM delete_test; + ^ +DROP TABLE delete_test ORDER BY id; +ERROR: syntax error at or near "ORDER" +LINE 1: DROP TABLE delete_test ORDER BY id; + ^ ----------------------------------------------------------------------- Summary of changes: src/test/regress/expected/delete_1.out | 37 ++++++++++++++++++++++++++++++++ 1 files changed, 37 insertions(+), 0 deletions(-) create mode 100644 src/test/regress/expected/delete_1.out hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-03-22 17:10:00
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via 9265ae6c81b0bf499ab010736125f7ffca812c0e (commit) from 894c0a4564c20ec339b6d9a098af8e19d439b81a (commit) - Log ----------------------------------------------------------------- commit 9265ae6c81b0bf499ab010736125f7ffca812c0e Author: Michael P <mic...@us...> Date: Wed Mar 23 02:08:59 2011 +0900 Fix for regression test update Distribution column cannot be updated in current version of Postgres-XC, so this output is correct. diff --git a/src/test/regress/expected/update_1.out b/src/test/regress/expected/update_1.out new file mode 100644 index 0000000..2227eaa --- /dev/null +++ b/src/test/regress/expected/update_1.out @@ -0,0 +1,94 @@ +-- +-- UPDATE syntax tests +-- +CREATE TABLE update_test ( + a INT DEFAULT 10, + b INT, + c TEXT +); +INSERT INTO update_test VALUES (5, 10, 'foo'); +INSERT INTO update_test(b, a) VALUES (15, 10); +SELECT * FROM update_test ORDER BY a, b, c; + a | b | c +----+----+----- + 5 | 10 | foo + 10 | 15 | +(2 rows) + +UPDATE update_test SET a = DEFAULT, b = DEFAULT; +ERROR: Partition column can't be updated in current version +SELECT * FROM update_test ORDER BY a, b, c; + a | b | c +----+----+----- + 5 | 10 | foo + 10 | 15 | +(2 rows) + +-- aliases for the UPDATE target table +UPDATE update_test AS t SET b = 10 WHERE t.a = 10; +SELECT * FROM update_test ORDER BY a, b, c; + a | b | c +----+----+----- + 5 | 10 | foo + 10 | 10 | +(2 rows) + +UPDATE update_test t SET b = t.b + 10 WHERE t.a = 10; +SELECT * FROM update_test ORDER BY a, b, c; + a | b | c +----+----+----- + 5 | 10 | foo + 10 | 20 | +(2 rows) + +-- +-- Test VALUES in FROM +-- +UPDATE update_test SET a=v.i FROM (VALUES(100, 20)) AS v(i, j) + WHERE update_test.b = v.j; +ERROR: Partition column can't be updated in current version +SELECT * FROM update_test ORDER BY a, b, c; + a | b | c +----+----+----- + 5 | 10 | foo + 10 | 20 | +(2 rows) + +-- +-- Test multiple-set-clause syntax +-- +UPDATE update_test SET (c,b,a) = ('bugle', b+11, DEFAULT) WHERE c = 'foo'; +ERROR: Partition column can't be updated in current version +SELECT * FROM update_test ORDER BY a, b, c; + a | b | c +----+----+----- + 5 | 10 | foo + 10 | 20 | +(2 rows) + +UPDATE update_test SET (c,b) = ('car', a+b), a = a + 1 WHERE a = 10; +ERROR: Partition column can't be updated in current version +SELECT * FROM update_test ORDER BY a, b, c; + a | b | c +----+----+----- + 5 | 10 | foo + 10 | 20 | +(2 rows) + +-- fail, multi assignment to same column: +UPDATE update_test SET (c,b) = ('car', a+b), b = a + 1 WHERE a = 10; +ERROR: multiple assignments to same column "b" +-- XXX this should work, but doesn't yet: +UPDATE update_test SET (a,b) = (select a,b FROM update_test where c = 'foo') + WHERE a = 10; +ERROR: syntax error at or near "select" +LINE 1: UPDATE update_test SET (a,b) = (select a,b FROM update_test ... + ^ +-- if an alias for the target table is specified, don't allow references +-- to the original table name +UPDATE update_test AS t SET b = update_test.b + 10 WHERE t.a = 10; +ERROR: invalid reference to FROM-clause entry for table "update_test" +LINE 1: UPDATE update_test AS t SET b = update_test.b + 10 WHERE t.a... + ^ +HINT: Perhaps you meant to reference the table alias "t". +DROP TABLE update_test; ----------------------------------------------------------------------- Summary of changes: .../regress/expected/{update.out => update_1.out} | 40 +++++++++++--------- 1 files changed, 22 insertions(+), 18 deletions(-) copy src/test/regress/expected/{update.out => update_1.out} (80%) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-03-22 16:35:15
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via 894c0a4564c20ec339b6d9a098af8e19d439b81a (commit) from 75bff5c22b1d721af3ef88268c5c15624ed0b1d3 (commit) - Log ----------------------------------------------------------------- commit 894c0a4564c20ec339b6d9a098af8e19d439b81a Author: Michael P <mic...@us...> Date: Wed Mar 23 01:34:26 2011 +0900 Fix for regression test guc SAVEPOINT and TEMP tables are not supported yet by XC, so this output is correct. diff --git a/src/test/regress/expected/guc_1.out b/src/test/regress/expected/guc_1.out new file mode 100644 index 0000000..d71a66c --- /dev/null +++ b/src/test/regress/expected/guc_1.out @@ -0,0 +1,610 @@ +-- pg_regress should ensure that this default value applies; however +-- we can't rely on any specific default value of vacuum_cost_delay +SHOW datestyle; + DateStyle +--------------- + Postgres, MDY +(1 row) + +-- SET to some nondefault value +SET vacuum_cost_delay TO 40; +SET datestyle = 'ISO, YMD'; +SHOW vacuum_cost_delay; + vacuum_cost_delay +------------------- + 40ms +(1 row) + +SHOW datestyle; + DateStyle +----------- + ISO, YMD +(1 row) + +SELECT '2006-08-13 12:34:56'::timestamptz; + timestamptz +------------------------ + 2006-08-13 12:34:56-07 +(1 row) + +-- SET LOCAL has no effect outside of a transaction +SET LOCAL vacuum_cost_delay TO 50; +SHOW vacuum_cost_delay; + vacuum_cost_delay +------------------- + 40ms +(1 row) + +SET LOCAL datestyle = 'SQL'; +SHOW datestyle; + DateStyle +----------- + ISO, YMD +(1 row) + +SELECT '2006-08-13 12:34:56'::timestamptz; + timestamptz +------------------------ + 2006-08-13 12:34:56-07 +(1 row) + +-- SET LOCAL within a transaction that commits +BEGIN; +SET LOCAL vacuum_cost_delay TO 50; +SHOW vacuum_cost_delay; + vacuum_cost_delay +------------------- + 50ms +(1 row) + +SET LOCAL datestyle = 'SQL'; +SHOW datestyle; + DateStyle +----------- + SQL, YMD +(1 row) + +SELECT '2006-08-13 12:34:56'::timestamptz; + timestamptz +------------------------- + 08/13/2006 12:34:56 PDT +(1 row) + +COMMIT; +SHOW vacuum_cost_delay; + vacuum_cost_delay +------------------- + 40ms +(1 row) + +SHOW datestyle; + DateStyle +----------- + ISO, YMD +(1 row) + +SELECT '2006-08-13 12:34:56'::timestamptz; + timestamptz +------------------------ + 2006-08-13 12:34:56-07 +(1 row) + +-- SET should be reverted after ROLLBACK +BEGIN; +SET vacuum_cost_delay TO 60; +SHOW vacuum_cost_delay; + vacuum_cost_delay +------------------- + 60ms +(1 row) + +SET datestyle = 'German'; +SHOW datestyle; + DateStyle +------------- + German, DMY +(1 row) + +SELECT '2006-08-13 12:34:56'::timestamptz; + timestamptz +------------------------- + 13.08.2006 12:34:56 PDT +(1 row) + +ROLLBACK; +SHOW vacuum_cost_delay; + vacuum_cost_delay +------------------- + 40ms +(1 row) + +SHOW datestyle; + DateStyle +----------- + ISO, YMD +(1 row) + +SELECT '2006-08-13 12:34:56'::timestamptz; + timestamptz +------------------------ + 2006-08-13 12:34:56-07 +(1 row) + +-- Some tests with subtransactions +BEGIN; +SET vacuum_cost_delay TO 70; +SET datestyle = 'MDY'; +SHOW datestyle; + DateStyle +----------- + ISO, MDY +(1 row) + +SELECT '2006-08-13 12:34:56'::timestamptz; + timestamptz +------------------------ + 2006-08-13 12:34:56-07 +(1 row) + +SAVEPOINT first_sp; +ERROR: SAVEPOINT is not yet supported. +SET vacuum_cost_delay TO 80; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SHOW vacuum_cost_delay; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SET datestyle = 'German, DMY'; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SHOW datestyle; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SELECT '2006-08-13 12:34:56'::timestamptz; +ERROR: current transaction is aborted, commands ignored until end of transaction block +ROLLBACK TO first_sp; +ERROR: no such savepoint +SHOW datestyle; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SELECT '2006-08-13 12:34:56'::timestamptz; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SAVEPOINT second_sp; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SET vacuum_cost_delay TO 90; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SET datestyle = 'SQL, YMD'; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SHOW datestyle; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SELECT '2006-08-13 12:34:56'::timestamptz; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SAVEPOINT third_sp; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SET vacuum_cost_delay TO 100; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SHOW vacuum_cost_delay; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SET datestyle = 'Postgres, MDY'; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SHOW datestyle; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SELECT '2006-08-13 12:34:56'::timestamptz; +ERROR: current transaction is aborted, commands ignored until end of transaction block +ROLLBACK TO third_sp; +ERROR: no such savepoint +SHOW vacuum_cost_delay; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SHOW datestyle; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SELECT '2006-08-13 12:34:56'::timestamptz; +ERROR: current transaction is aborted, commands ignored until end of transaction block +ROLLBACK TO second_sp; +ERROR: no such savepoint +SHOW vacuum_cost_delay; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SHOW datestyle; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SELECT '2006-08-13 12:34:56'::timestamptz; +ERROR: current transaction is aborted, commands ignored until end of transaction block +ROLLBACK; +SHOW vacuum_cost_delay; + vacuum_cost_delay +------------------- + 40ms +(1 row) + +SHOW datestyle; + DateStyle +----------- + ISO, YMD +(1 row) + +SELECT '2006-08-13 12:34:56'::timestamptz; + timestamptz +------------------------ + 2006-08-13 12:34:56-07 +(1 row) + +-- SET LOCAL with Savepoints +BEGIN; +SHOW vacuum_cost_delay; + vacuum_cost_delay +------------------- + 40ms +(1 row) + +SHOW datestyle; + DateStyle +----------- + ISO, YMD +(1 row) + +SELECT '2006-08-13 12:34:56'::timestamptz; + timestamptz +------------------------ + 2006-08-13 12:34:56-07 +(1 row) + +SAVEPOINT sp; +ERROR: SAVEPOINT is not yet supported. +SET LOCAL vacuum_cost_delay TO 30; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SHOW vacuum_cost_delay; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SET LOCAL datestyle = 'Postgres, MDY'; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SHOW datestyle; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SELECT '2006-08-13 12:34:56'::timestamptz; +ERROR: current transaction is aborted, commands ignored until end of transaction block +ROLLBACK TO sp; +ERROR: no such savepoint +SHOW vacuum_cost_delay; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SHOW datestyle; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SELECT '2006-08-13 12:34:56'::timestamptz; +ERROR: current transaction is aborted, commands ignored until end of transaction block +ROLLBACK; +SHOW vacuum_cost_delay; + vacuum_cost_delay +------------------- + 40ms +(1 row) + +SHOW datestyle; + DateStyle +----------- + ISO, YMD +(1 row) + +SELECT '2006-08-13 12:34:56'::timestamptz; + timestamptz +------------------------ + 2006-08-13 12:34:56-07 +(1 row) + +-- SET LOCAL persists through RELEASE (which was not true in 8.0-8.2) +BEGIN; +SHOW vacuum_cost_delay; + vacuum_cost_delay +------------------- + 40ms +(1 row) + +SHOW datestyle; + DateStyle +----------- + ISO, YMD +(1 row) + +SELECT '2006-08-13 12:34:56'::timestamptz; + timestamptz +------------------------ + 2006-08-13 12:34:56-07 +(1 row) + +SAVEPOINT sp; +ERROR: SAVEPOINT is not yet supported. +SET LOCAL vacuum_cost_delay TO 30; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SHOW vacuum_cost_delay; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SET LOCAL datestyle = 'Postgres, MDY'; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SHOW datestyle; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SELECT '2006-08-13 12:34:56'::timestamptz; +ERROR: current transaction is aborted, commands ignored until end of transaction block +RELEASE SAVEPOINT sp; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SHOW vacuum_cost_delay; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SHOW datestyle; +ERROR: current transaction is aborted, commands ignored until end of transaction block +SELECT '2006-08-13 12:34:56'::timestamptz; +ERROR: current transaction is aborted, commands ignored until end of transaction block +ROLLBACK; +SHOW vacuum_cost_delay; + vacuum_cost_delay +------------------- + 40ms +(1 row) + +SHOW datestyle; + DateStyle +----------- + ISO, YMD +(1 row) + +SELECT '2006-08-13 12:34:56'::timestamptz; + timestamptz +------------------------ + 2006-08-13 12:34:56-07 +(1 row) + +-- SET followed by SET LOCAL +BEGIN; +SET vacuum_cost_delay TO 40; +SET LOCAL vacuum_cost_delay TO 50; +SHOW vacuum_cost_delay; + vacuum_cost_delay +------------------- + 50ms +(1 row) + +SET datestyle = 'ISO, DMY'; +SET LOCAL datestyle = 'Postgres, MDY'; +SHOW datestyle; + DateStyle +--------------- + Postgres, MDY +(1 row) + +SELECT '2006-08-13 12:34:56'::timestamptz; + timestamptz +------------------------------ + Sun Aug 13 12:34:56 2006 PDT +(1 row) + +COMMIT; +SHOW vacuum_cost_delay; + vacuum_cost_delay +------------------- + 40ms +(1 row) + +SHOW datestyle; + DateStyle +----------- + ISO, DMY +(1 row) + +SELECT '2006-08-13 12:34:56'::timestamptz; + timestamptz +------------------------ + 2006-08-13 12:34:56-07 +(1 row) + +-- +-- Test RESET. We use datestyle because the reset value is forced by +-- pg_regress, so it doesn't depend on the installation's configuration. +-- +SET datestyle = iso, ymd; +SHOW datestyle; + DateStyle +----------- + ISO, YMD +(1 row) + +SELECT '2006-08-13 12:34:56'::timestamptz; + timestamptz +------------------------ + 2006-08-13 12:34:56-07 +(1 row) + +RESET datestyle; +SHOW datestyle; + DateStyle +--------------- + Postgres, MDY +(1 row) + +SELECT '2006-08-13 12:34:56'::timestamptz; + timestamptz +------------------------------ + Sun Aug 13 12:34:56 2006 PDT +(1 row) + +-- +-- Test DISCARD TEMP +-- +CREATE TEMP TABLE reset_test ( data text ) ON COMMIT DELETE ROWS; +ERROR: PG-XC does not yet support temporary tables +SELECT relname FROM pg_class WHERE relname = 'reset_test'; + relname +--------- +(0 rows) + +DISCARD TEMP; +SELECT relname FROM pg_class WHERE relname = 'reset_test'; + relname +--------- +(0 rows) + +-- +-- Test DISCARD ALL +-- +-- do changes +DECLARE foo CURSOR WITH HOLD FOR SELECT 1; +PREPARE foo AS SELECT 1; +ERROR: Postgres-XC does not support PREPARE yet +DETAIL: The feature is not currently supported +LISTEN foo_event; +SET vacuum_cost_delay = 13; +CREATE TEMP TABLE tmp_foo (data text) ON COMMIT DELETE ROWS; +ERROR: PG-XC does not yet support temporary tables +CREATE ROLE temp_reset_user; +SET SESSION AUTHORIZATION temp_reset_user; +-- look changes +SELECT pg_listening_channels(); + pg_listening_channels +----------------------- + foo_event +(1 row) + +SELECT name FROM pg_prepared_statements; + name +------ +(0 rows) + +SELECT name FROM pg_cursors; + name +------ + foo +(1 row) + +SHOW vacuum_cost_delay; + vacuum_cost_delay +------------------- + 13ms +(1 row) + +SELECT relname from pg_class where relname = 'tmp_foo'; + relname +--------- +(0 rows) + +SELECT current_user = 'temp_reset_user'; + ?column? +---------- + t +(1 row) + +-- discard everything +DISCARD ALL; +-- look again +SELECT pg_listening_channels(); + pg_listening_channels +----------------------- +(0 rows) + +SELECT name FROM pg_prepared_statements; + name +------ +(0 rows) + +SELECT name FROM pg_cursors; + name +------ +(0 rows) + +SHOW vacuum_cost_delay; + vacuum_cost_delay +------------------- + 0 +(1 row) + +SELECT relname from pg_class where relname = 'tmp_foo'; + relname +--------- +(0 rows) + +SELECT current_user = 'temp_reset_user'; + ?column? +---------- + f +(1 row) + +DROP ROLE temp_reset_user; +-- +-- Tests for function-local GUC settings +-- +set work_mem = '3MB'; +create function report_guc(text) returns text as +$$ select current_setting($1) $$ language sql +set work_mem = '1MB'; +select report_guc('work_mem'), current_setting('work_mem'); + report_guc | current_setting +------------+----------------- + 1MB | 3MB +(1 row) + +-- this should draw only a warning +alter function report_guc(text) set search_path = no_such_schema; +NOTICE: schema "no_such_schema" does not exist +-- with error occurring here +select report_guc('work_mem'), current_setting('work_mem'); +ERROR: schema "no_such_schema" does not exist +alter function report_guc(text) reset search_path set work_mem = '2MB'; +select report_guc('work_mem'), current_setting('work_mem'); + report_guc | current_setting +------------+----------------- + 2MB | 3MB +(1 row) + +alter function report_guc(text) reset all; +select report_guc('work_mem'), current_setting('work_mem'); + report_guc | current_setting +------------+----------------- + 3MB | 3MB +(1 row) + +-- SET LOCAL is restricted by a function SET option +create or replace function myfunc(int) returns text as $$ +begin + set local work_mem = '2MB'; + return current_setting('work_mem'); +end $$ +language plpgsql +set work_mem = '1MB'; +select myfunc(0), current_setting('work_mem'); + myfunc | current_setting +--------+----------------- + 2MB | 3MB +(1 row) + +alter function myfunc(int) reset all; +select myfunc(0), current_setting('work_mem'); + myfunc | current_setting +--------+----------------- + 2MB | 2MB +(1 row) + +set work_mem = '3MB'; +-- but SET isn't +create or replace function myfunc(int) returns text as $$ +begin + set work_mem = '2MB'; + return current_setting('work_mem'); +end $$ +language plpgsql +set work_mem = '1MB'; +select myfunc(0), current_setting('work_mem'); + myfunc | current_setting +--------+----------------- + 2MB | 2MB +(1 row) + +set work_mem = '3MB'; +-- it should roll back on error, though +create or replace function myfunc(int) returns text as $$ +begin + set work_mem = '2MB'; + perform 1/$1; + return current_setting('work_mem'); +end $$ +language plpgsql +set work_mem = '1MB'; +select myfunc(0); +ERROR: division by zero +CONTEXT: SQL statement "SELECT 1/$1" +PL/pgSQL function "myfunc" line 3 at PERFORM +select current_setting('work_mem'); + current_setting +----------------- + 3MB +(1 row) + +select myfunc(1), current_setting('work_mem'); + myfunc | current_setting +--------+----------------- + 2MB | 2MB +(1 row) + ----------------------------------------------------------------------- Summary of changes: src/test/regress/expected/{guc.out => guc_1.out} | 205 ++++++---------------- 1 files changed, 57 insertions(+), 148 deletions(-) copy src/test/regress/expected/{guc.out => guc_1.out} (72%) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-03-22 16:23:00
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via 75bff5c22b1d721af3ef88268c5c15624ed0b1d3 (commit) from e9b0fdc80dd5822b3b737fdd1c97891a8287c524 (commit) - Log ----------------------------------------------------------------- commit 75bff5c22b1d721af3ef88268c5c15624ed0b1d3 Author: Michael P <mic...@us...> Date: Wed Mar 23 01:21:33 2011 +0900 Fix for regression test case Partition column of a table cannot be updated, so this output is correct. diff --git a/src/test/regress/expected/case_1.out b/src/test/regress/expected/case_1.out new file mode 100644 index 0000000..f56285f --- /dev/null +++ b/src/test/regress/expected/case_1.out @@ -0,0 +1,314 @@ +-- +-- CASE +-- Test the case statement +-- +CREATE TABLE CASE_TBL ( + i integer, + f double precision +); +CREATE TABLE CASE2_TBL ( + i integer, + j integer +); +INSERT INTO CASE_TBL VALUES (1, 10.1); +INSERT INTO CASE_TBL VALUES (2, 20.2); +INSERT INTO CASE_TBL VALUES (3, -30.3); +INSERT INTO CASE_TBL VALUES (4, NULL); +INSERT INTO CASE2_TBL VALUES (1, -1); +INSERT INTO CASE2_TBL VALUES (2, -2); +INSERT INTO CASE2_TBL VALUES (3, -3); +INSERT INTO CASE2_TBL VALUES (2, -4); +INSERT INTO CASE2_TBL VALUES (1, NULL); +INSERT INTO CASE2_TBL VALUES (NULL, -6); +-- +-- Simplest examples without tables +-- +SELECT '3' AS "One", + CASE + WHEN 1 < 2 THEN 3 + END AS "Simple WHEN"; + One | Simple WHEN +-----+------------- + 3 | 3 +(1 row) + +SELECT '<NULL>' AS "One", + CASE + WHEN 1 > 2 THEN 3 + END AS "Simple default"; + One | Simple default +--------+---------------- + <NULL> | +(1 row) + +SELECT '3' AS "One", + CASE + WHEN 1 < 2 THEN 3 + ELSE 4 + END AS "Simple ELSE"; + One | Simple ELSE +-----+------------- + 3 | 3 +(1 row) + +SELECT '4' AS "One", + CASE + WHEN 1 > 2 THEN 3 + ELSE 4 + END AS "ELSE default"; + One | ELSE default +-----+-------------- + 4 | 4 +(1 row) + +SELECT '6' AS "One", + CASE + WHEN 1 > 2 THEN 3 + WHEN 4 < 5 THEN 6 + ELSE 7 + END AS "Two WHEN with default"; + One | Two WHEN with default +-----+----------------------- + 6 | 6 +(1 row) + +-- Constant-expression folding shouldn't evaluate unreachable subexpressions +SELECT CASE WHEN 1=0 THEN 1/0 WHEN 1=1 THEN 1 ELSE 2/0 END; + case +------ + 1 +(1 row) + +SELECT CASE 1 WHEN 0 THEN 1/0 WHEN 1 THEN 1 ELSE 2/0 END; + case +------ + 1 +(1 row) + +-- However we do not currently suppress folding of potentially +-- reachable subexpressions +SELECT CASE WHEN i > 100 THEN 1/0 ELSE 0 END FROM case_tbl; +ERROR: division by zero +-- Test for cases involving untyped literals in test expression +SELECT CASE 'a' WHEN 'a' THEN 1 ELSE 2 END; + case +------ + 1 +(1 row) + +-- +-- Examples of targets involving tables +-- +SELECT '' AS "Five", + CASE + WHEN i >= 3 THEN i + END AS ">= 3 or Null" + FROM CASE_TBL + ORDER BY 2; + Five | >= 3 or Null +------+-------------- + | 3 + | 4 + | + | +(4 rows) + +SELECT '' AS "Five", + CASE WHEN i >= 3 THEN (i + i) + ELSE i + END AS "Simplest Math" + FROM CASE_TBL + ORDER BY 2; + Five | Simplest Math +------+--------------- + | 1 + | 2 + | 6 + | 8 +(4 rows) + +SELECT '' AS "Five", i AS "Value", + CASE WHEN (i < 0) THEN 'small' + WHEN (i = 0) THEN 'zero' + WHEN (i = 1) THEN 'one' + WHEN (i = 2) THEN 'two' + ELSE 'big' + END AS "Category" + FROM CASE_TBL + ORDER BY 2, 3; + Five | Value | Category +------+-------+---------- + | 1 | one + | 2 | two + | 3 | big + | 4 | big +(4 rows) + +SELECT '' AS "Five", + CASE WHEN ((i < 0) or (i < 0)) THEN 'small' + WHEN ((i = 0) or (i = 0)) THEN 'zero' + WHEN ((i = 1) or (i = 1)) THEN 'one' + WHEN ((i = 2) or (i = 2)) THEN 'two' + ELSE 'big' + END AS "Category" + FROM CASE_TBL + ORDER BY 2; + Five | Category +------+---------- + | big + | big + | one + | two +(4 rows) + +-- +-- Examples of qualifications involving tables +-- +-- +-- NULLIF() and COALESCE() +-- Shorthand forms for typical CASE constructs +-- defined in the SQL92 standard. +-- +SELECT * FROM CASE_TBL WHERE COALESCE(f,i) = 4; + i | f +---+--- + 4 | +(1 row) + +SELECT * FROM CASE_TBL WHERE NULLIF(f,i) = 2; + i | f +---+--- +(0 rows) + +SELECT COALESCE(a.f, b.i, b.j) + FROM CASE_TBL a, CASE2_TBL b + ORDER BY coalesce; + coalesce +---------- + -30.3 + -30.3 + -30.3 + -30.3 + -30.3 + -30.3 + -6 + 1 + 1 + 2 + 2 + 3 + 10.1 + 10.1 + 10.1 + 10.1 + 10.1 + 10.1 + 20.2 + 20.2 + 20.2 + 20.2 + 20.2 + 20.2 +(24 rows) + +SELECT * + FROM CASE_TBL a, CASE2_TBL b + WHERE COALESCE(a.f, b.i, b.j) = 2 + ORDER BY a.i, a.f, b.i, b.j; + i | f | i | j +---+---+---+---- + 4 | | 2 | -4 + 4 | | 2 | -2 +(2 rows) + +SELECT '' AS Five, NULLIF(a.i,b.i) AS "NULLIF(a.i,b.i)", + NULLIF(b.i, 4) AS "NULLIF(b.i,4)" + FROM CASE_TBL a, CASE2_TBL b + ORDER BY 2, 3; + five | NULLIF(a.i,b.i) | NULLIF(b.i,4) +------+-----------------+--------------- + | 1 | 2 + | 1 | 2 + | 1 | 3 + | 1 | + | 2 | 1 + | 2 | 1 + | 2 | 3 + | 2 | + | 3 | 1 + | 3 | 1 + | 3 | 2 + | 3 | 2 + | 3 | + | 4 | 1 + | 4 | 1 + | 4 | 2 + | 4 | 2 + | 4 | 3 + | 4 | + | | 1 + | | 1 + | | 2 + | | 2 + | | 3 +(24 rows) + +SELECT '' AS "Two", * + FROM CASE_TBL a, CASE2_TBL b + WHERE COALESCE(f,b.i) = 2 + ORDER BY a.i, a.f, b.i, b.j; + Two | i | f | i | j +-----+---+---+---+---- + | 4 | | 2 | -4 + | 4 | | 2 | -2 +(2 rows) + +-- +-- Examples of updates involving tables +-- +UPDATE CASE_TBL + SET i = CASE WHEN i >= 3 THEN (- i) + ELSE (2 * i) END; +ERROR: Partition column can't be updated in current version +SELECT * FROM CASE_TBL ORDER BY i, f; + i | f +---+------- + 1 | 10.1 + 2 | 20.2 + 3 | -30.3 + 4 | +(4 rows) + +UPDATE CASE_TBL + SET i = CASE WHEN i >= 2 THEN (2 * i) + ELSE (3 * i) END; +ERROR: Partition column can't be updated in current version +SELECT * FROM CASE_TBL ORDER BY i, f; + i | f +---+------- + 1 | 10.1 + 2 | 20.2 + 3 | -30.3 + 4 | +(4 rows) + +UPDATE CASE_TBL + SET i = CASE WHEN b.i >= 2 THEN (2 * j) + ELSE (3 * j) END + FROM CASE2_TBL b + WHERE j = -CASE_TBL.i; +ERROR: Partition column can't be updated in current version +SELECT * FROM CASE_TBL ORDER BY i, f; + i | f +---+------- + 1 | 10.1 + 2 | 20.2 + 3 | -30.3 + 4 | +(4 rows) + +-- +-- Clean up +-- +DROP TABLE CASE_TBL; +DROP TABLE CASE2_TBL; ----------------------------------------------------------------------- Summary of changes: src/test/regress/expected/{case.out => case_1.out} | 39 +++++++++++--------- 1 files changed, 21 insertions(+), 18 deletions(-) copy src/test/regress/expected/{case.out => case_1.out} (94%) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-03-22 15:49:56
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via e9b0fdc80dd5822b3b737fdd1c97891a8287c524 (commit) from 6bc68eefd4558dedc4228335f3f693727dbf47bc (commit) - Log ----------------------------------------------------------------- commit e9b0fdc80dd5822b3b737fdd1c97891a8287c524 Author: Michael P <mic...@us...> Date: Wed Mar 23 00:48:36 2011 +0900 Fix for regression test prepare PREPARE and EXECUTE are not supported yet by Postgres-XC, so this output is suited. diff --git a/src/test/regress/expected/prepare_1.out b/src/test/regress/expected/prepare_1.out new file mode 100644 index 0000000..06f1e73 --- /dev/null +++ b/src/test/regress/expected/prepare_1.out @@ -0,0 +1,126 @@ +-- Regression tests for prepareable statements. We query the content +-- of the pg_prepared_statements view as prepared statements are +-- created and removed. +SELECT name, statement, parameter_types FROM pg_prepared_statements; + name | statement | parameter_types +------+-----------+----------------- +(0 rows) + +PREPARE q1 AS SELECT 1 AS a; +ERROR: Postgres-XC does not support PREPARE yet +DETAIL: The feature is not currently supported +EXECUTE q1; +ERROR: Postgres-XC does not support EXECUTE yet +DETAIL: The feature is not currently supported +SELECT name, statement, parameter_types FROM pg_prepared_statements; + name | statement | parameter_types +------+-----------+----------------- +(0 rows) + +-- should fail +PREPARE q1 AS SELECT 2; +ERROR: Postgres-XC does not support PREPARE yet +DETAIL: The feature is not currently supported +-- should succeed +DEALLOCATE q1; +ERROR: prepared statement "q1" does not exist +PREPARE q1 AS SELECT 2; +ERROR: Postgres-XC does not support PREPARE yet +DETAIL: The feature is not currently supported +EXECUTE q1; +ERROR: Postgres-XC does not support EXECUTE yet +DETAIL: The feature is not currently supported +PREPARE q2 AS SELECT 2 AS b; +ERROR: Postgres-XC does not support PREPARE yet +DETAIL: The feature is not currently supported +SELECT name, statement, parameter_types FROM pg_prepared_statements ORDER BY name; + name | statement | parameter_types +------+-----------+----------------- +(0 rows) + +-- sql92 syntax +DEALLOCATE PREPARE q1; +ERROR: prepared statement "q1" does not exist +SELECT name, statement, parameter_types FROM pg_prepared_statements; + name | statement | parameter_types +------+-----------+----------------- +(0 rows) + +DEALLOCATE PREPARE q2; +ERROR: prepared statement "q2" does not exist +-- the view should return the empty set again +SELECT name, statement, parameter_types FROM pg_prepared_statements; + name | statement | parameter_types +------+-----------+----------------- +(0 rows) + +-- parameterized queries +PREPARE q2(text) AS + SELECT datname, datistemplate, datallowconn + FROM pg_database WHERE datname = $1; +ERROR: Postgres-XC does not support PREPARE yet +DETAIL: The feature is not currently supported +EXECUTE q2('postgres'); +ERROR: Postgres-XC does not support EXECUTE yet +DETAIL: The feature is not currently supported +PREPARE q3(text, int, float, boolean, oid, smallint) AS + SELECT * FROM tenk1 WHERE string4 = $1 AND (four = $2 OR + ten = $3::bigint OR true = $4 OR oid = $5 OR odd = $6::int) + ORDER BY unique1; +ERROR: Postgres-XC does not support PREPARE yet +DETAIL: The feature is not currently supported +EXECUTE q3('AAAAxx', 5::smallint, 10.5::float, false, 500::oid, 4::bigint); +ERROR: Postgres-XC does not support EXECUTE yet +DETAIL: The feature is not currently supported +-- too few params +EXECUTE q3('bool'); +ERROR: Postgres-XC does not support EXECUTE yet +DETAIL: The feature is not currently supported +-- too many params +EXECUTE q3('bytea', 5::smallint, 10.5::float, false, 500::oid, 4::bigint, true); +ERROR: Postgres-XC does not support EXECUTE yet +DETAIL: The feature is not currently supported +-- wrong param types +EXECUTE q3(5::smallint, 10.5::float, false, 500::oid, 4::bigint, 'bytea'); +ERROR: Postgres-XC does not support EXECUTE yet +DETAIL: The feature is not currently supported +-- invalid type +PREPARE q4(nonexistenttype) AS SELECT $1; +ERROR: Postgres-XC does not support PREPARE yet +DETAIL: The feature is not currently supported +-- create table as execute +PREPARE q5(int, text) AS + SELECT * FROM tenk1 WHERE unique1 = $1 OR stringu1 = $2 + ORDER BY unique1; +ERROR: Postgres-XC does not support PREPARE yet +DETAIL: The feature is not currently supported +CREATE TEMPORARY TABLE q5_prep_results AS EXECUTE q5(200, 'DTAAAA'); +ERROR: Postgres-XC does not support EXECUTE yet +DETAIL: The feature is not currently supported +SELECT * FROM q5_prep_results; +ERROR: relation "q5_prep_results" does not exist +LINE 1: SELECT * FROM q5_prep_results; + ^ +-- unknown or unspecified parameter types: should succeed +PREPARE q6 AS + SELECT * FROM tenk1 WHERE unique1 = $1 AND stringu1 = $2; +ERROR: Postgres-XC does not support PREPARE yet +DETAIL: The feature is not currently supported +PREPARE q7(unknown) AS + SELECT * FROM road WHERE thepath = $1; +ERROR: Postgres-XC does not support PREPARE yet +DETAIL: The feature is not currently supported +SELECT name, statement, parameter_types FROM pg_prepared_statements + ORDER BY name; + name | statement | parameter_types +------+-----------+----------------- +(0 rows) + +-- test DEALLOCATE ALL; +DEALLOCATE ALL; +SELECT name, statement, parameter_types FROM pg_prepared_statements + ORDER BY name; + name | statement | parameter_types +------+-----------+----------------- +(0 rows) + ----------------------------------------------------------------------- Summary of changes: src/test/regress/expected/prepare_1.out | 126 +++++++++++++++++++++++++++++++ 1 files changed, 126 insertions(+), 0 deletions(-) create mode 100644 src/test/regress/expected/prepare_1.out hooks/post-receive -- Postgres-XC |
From: Abbas B. <ga...@us...> - 2011-03-22 15:15:11
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via 6bc68eefd4558dedc4228335f3f693727dbf47bc (commit) from 0bd6f5672708a47b72c76a642ce335f1d7663d52 (commit) - Log ----------------------------------------------------------------- commit 6bc68eefd4558dedc4228335f3f693727dbf47bc Author: Abbas <abb...@en...> Date: Tue Mar 22 20:14:43 2011 +0500 Fix for server crash as mentioned in bug ID 3170715 diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c index 2aacf47..a361186 100644 --- a/src/backend/commands/explain.c +++ b/src/backend/commands/explain.c @@ -1518,6 +1518,12 @@ ExplainScanTarget(Scan *plan, ExplainState *es) if (plan->scanrelid <= 0) /* Is this still possible? */ return; + +#ifdef PGXC + if (es->rtable == NULL || plan->scanrelid >= es->rtable->length || plan->scanrelid < 0) + return; +#endif + rte = rt_fetch(plan->scanrelid, es->rtable); switch (nodeTag(plan)) ----------------------------------------------------------------------- Summary of changes: src/backend/commands/explain.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-03-22 15:06:04
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via 0bd6f5672708a47b72c76a642ce335f1d7663d52 (commit) from b8593ff58077e29c21c5f1ed50e622b0cf882b8c (commit) - Log ----------------------------------------------------------------- commit 0bd6f5672708a47b72c76a642ce335f1d7663d52 Author: Michael P <mic...@us...> Date: Wed Mar 23 00:05:03 2011 +0900 Fix for regression test triggers Triggers are not yet supported by XC, so this output is OK. diff --git a/src/test/regress/expected/triggers_1.out b/src/test/regress/expected/triggers_1.out new file mode 100644 index 0000000..5528c66 --- /dev/null +++ b/src/test/regress/expected/triggers_1.out @@ -0,0 +1,747 @@ +-- +-- TRIGGERS +-- +create table pkeys (pkey1 int4 not null, pkey2 text not null); +create table fkeys (fkey1 int4, fkey2 text, fkey3 int); +create table fkeys2 (fkey21 int4, fkey22 text, pkey23 int not null); +create index fkeys_i on fkeys (fkey1, fkey2); +create index fkeys2_i on fkeys2 (fkey21, fkey22); +create index fkeys2p_i on fkeys2 (pkey23); +insert into pkeys values (10, '1'); +insert into pkeys values (20, '2'); +insert into pkeys values (30, '3'); +insert into pkeys values (40, '4'); +insert into pkeys values (50, '5'); +insert into pkeys values (60, '6'); +create unique index pkeys_i on pkeys (pkey1, pkey2); +-- +-- For fkeys: +-- (fkey1, fkey2) --> pkeys (pkey1, pkey2) +-- (fkey3) --> fkeys2 (pkey23) +-- +create trigger check_fkeys_pkey_exist + before insert or update on fkeys + for each row + execute procedure + check_primary_key ('fkey1', 'fkey2', 'pkeys', 'pkey1', 'pkey2'); +ERROR: Postgres-XC does not support TRIGGER yet +DETAIL: The feature is not currently supported +create trigger check_fkeys_pkey2_exist + before insert or update on fkeys + for each row + execute procedure check_primary_key ('fkey3', 'fkeys2', 'pkey23'); +ERROR: Postgres-XC does not support TRIGGER yet +DETAIL: The feature is not currently supported +-- +-- For fkeys2: +-- (fkey21, fkey22) --> pkeys (pkey1, pkey2) +-- +create trigger check_fkeys2_pkey_exist + before insert or update on fkeys2 + for each row + execute procedure + check_primary_key ('fkey21', 'fkey22', 'pkeys', 'pkey1', 'pkey2'); +ERROR: Postgres-XC does not support TRIGGER yet +DETAIL: The feature is not currently supported +-- Test comments +COMMENT ON TRIGGER check_fkeys2_pkey_bad ON fkeys2 IS 'wrong'; +ERROR: trigger "check_fkeys2_pkey_bad" for table "fkeys2" does not exist +COMMENT ON TRIGGER check_fkeys2_pkey_exist ON fkeys2 IS 'right'; +ERROR: trigger "check_fkeys2_pkey_exist" for table "fkeys2" does not exist +COMMENT ON TRIGGER check_fkeys2_pkey_exist ON fkeys2 IS NULL; +ERROR: trigger "check_fkeys2_pkey_exist" for table "fkeys2" does not exist +-- +-- For pkeys: +-- ON DELETE/UPDATE (pkey1, pkey2) CASCADE: +-- fkeys (fkey1, fkey2) and fkeys2 (fkey21, fkey22) +-- +create trigger check_pkeys_fkey_cascade + before delete or update on pkeys + for each row + execute procedure + check_foreign_key (2, 'cascade', 'pkey1', 'pkey2', + 'fkeys', 'fkey1', 'fkey2', 'fkeys2', 'fkey21', 'fkey22'); +ERROR: Postgres-XC does not support TRIGGER yet +DETAIL: The feature is not currently supported +-- +-- For fkeys2: +-- ON DELETE/UPDATE (pkey23) RESTRICT: +-- fkeys (fkey3) +-- +create trigger check_fkeys2_fkey_restrict + before delete or update on fkeys2 + for each row + execute procedure check_foreign_key (1, 'restrict', 'pkey23', 'fkeys', 'fkey3'); +ERROR: Postgres-XC does not support TRIGGER yet +DETAIL: The feature is not currently supported +insert into fkeys2 values (10, '1', 1); +insert into fkeys2 values (30, '3', 2); +insert into fkeys2 values (40, '4', 5); +insert into fkeys2 values (50, '5', 3); +-- no key in pkeys +insert into fkeys2 values (70, '5', 3); +insert into fkeys values (10, '1', 2); +insert into fkeys values (30, '3', 3); +insert into fkeys values (40, '4', 2); +insert into fkeys values (50, '5', 2); +-- no key in pkeys +insert into fkeys values (70, '5', 1); +-- no key in fkeys2 +insert into fkeys values (60, '6', 4); +delete from pkeys where pkey1 = 30 and pkey2 = '3'; +delete from pkeys where pkey1 = 40 and pkey2 = '4'; +update pkeys set pkey1 = 7, pkey2 = '70' where pkey1 = 50 and pkey2 = '5'; +ERROR: Partition column can't be updated in current version +update pkeys set pkey1 = 7, pkey2 = '70' where pkey1 = 10 and pkey2 = '1'; +ERROR: Partition column can't be updated in current version +DROP TABLE pkeys; +DROP TABLE fkeys; +DROP TABLE fkeys2; +-- -- I've disabled the funny_dup17 test because the new semantics +-- -- of AFTER ROW triggers, which get now fired at the end of a +-- -- query always, cause funny_dup17 to enter an endless loop. +-- -- +-- -- Jan +-- +-- create table dup17 (x int4); +-- +-- create trigger dup17_before +-- before insert on dup17 +-- for each row +-- execute procedure +-- funny_dup17 () +-- ; +-- +-- insert into dup17 values (17); +-- select count(*) from dup17; +-- insert into dup17 values (17); +-- select count(*) from dup17; +-- +-- drop trigger dup17_before on dup17; +-- +-- create trigger dup17_after +-- after insert on dup17 +-- for each row +-- execute procedure +-- funny_dup17 () +-- ; +-- insert into dup17 values (13); +-- select count(*) from dup17 where x = 13; +-- insert into dup17 values (13); +-- select count(*) from dup17 where x = 13; +-- +-- DROP TABLE dup17; +create sequence ttdummy_seq increment 10 start 0 minvalue 0; +create table tttest ( + price_id int4, + price_val int4, + price_on int4, + price_off int4 default 999999 +); +create trigger ttdummy + before delete or update on tttest + for each row + execute procedure + ttdummy (price_on, price_off); +ERROR: Postgres-XC does not support TRIGGER yet +DETAIL: The feature is not currently supported +create trigger ttserial + before insert or update on tttest + for each row + execute procedure + autoinc (price_on, ttdummy_seq); +ERROR: Postgres-XC does not support TRIGGER yet +DETAIL: The feature is not currently supported +insert into tttest values (1, 1, null); +insert into tttest values (2, 2, null); +insert into tttest values (3, 3, 0); +select * from tttest order by 1,2,3,4; + price_id | price_val | price_on | price_off +----------+-----------+----------+----------- + 1 | 1 | | 999999 + 2 | 2 | | 999999 + 3 | 3 | 0 | 999999 +(3 rows) + +delete from tttest where price_id = 2; +select * from tttest order by 1,2,3,4; + price_id | price_val | price_on | price_off +----------+-----------+----------+----------- + 1 | 1 | | 999999 + 3 | 3 | 0 | 999999 +(2 rows) + +-- what do we see ? +-- get current prices +select * from tttest where price_off = 999999 order by 1,2,3,4; + price_id | price_val | price_on | price_off +----------+-----------+----------+----------- + 1 | 1 | | 999999 + 3 | 3 | 0 | 999999 +(2 rows) + +-- change price for price_id == 3 +update tttest set price_val = 30 where price_id = 3; +select * from tttest order by 1,2,3,4; + price_id | price_val | price_on | price_off +----------+-----------+----------+----------- + 1 | 1 | | 999999 + 3 | 30 | 0 | 999999 +(2 rows) + +-- now we want to change pric_id in ALL tuples +-- this gets us not what we need +update tttest set price_id = 5 where price_id = 3; +ERROR: Partition column can't be updated in current version +select * from tttest order by 1,2,3,4; + price_id | price_val | price_on | price_off +----------+-----------+----------+----------- + 1 | 1 | | 999999 + 3 | 30 | 0 | 999999 +(2 rows) + +-- restore data as before last update: +select set_ttdummy(0); + set_ttdummy +------------- + 1 +(1 row) + +delete from tttest where price_id = 5; +update tttest set price_off = 999999 where price_val = 30; +select * from tttest order by 1,2,3,4; + price_id | price_val | price_on | price_off +----------+-----------+----------+----------- + 1 | 1 | | 999999 + 3 | 30 | 0 | 999999 +(2 rows) + +-- and try change price_id now! +update tttest set price_id = 5 where price_id = 3; +ERROR: Partition column can't be updated in current version +select * from tttest order by 1,2,3,4; + price_id | price_val | price_on | price_off +----------+-----------+----------+----------- + 1 | 1 | | 999999 + 3 | 30 | 0 | 999999 +(2 rows) + +-- isn't it what we need ? +select set_ttdummy(1); + set_ttdummy +------------- + 0 +(1 row) + +-- we want to correct some "date" +update tttest set price_on = -1 where price_id = 1; +-- but this doesn't work +-- try in this way +select set_ttdummy(0); + set_ttdummy +------------- + 1 +(1 row) + +update tttest set price_on = -1 where price_id = 1; +select * from tttest order by 1,2,3,4; + price_id | price_val | price_on | price_off +----------+-----------+----------+----------- + 1 | 1 | -1 | 999999 + 3 | 30 | 0 | 999999 +(2 rows) + +-- isn't it what we need ? +-- get price for price_id == 5 as it was @ "date" 35 +select * from tttest where price_on <= 35 and price_off > 35 and price_id = 5 order by 1,2,3,4; + price_id | price_val | price_on | price_off +----------+-----------+----------+----------- +(0 rows) + +drop table tttest; +drop sequence ttdummy_seq; +-- +-- tests for per-statement triggers +-- +CREATE TABLE log_table (tstamp timestamp default timeofday()::timestamp); +CREATE TABLE main_table (a int, b int); +COPY main_table (a,b) FROM stdin; +CREATE FUNCTION trigger_func() RETURNS trigger LANGUAGE plpgsql AS ' +BEGIN + RAISE NOTICE ''trigger_func(%) called: action = %, when = %, level = %'', TG_ARGV[0], TG_OP, TG_WHEN, TG_LEVEL; + RETURN NULL; +END;'; +CREATE TRIGGER before_ins_stmt_trig BEFORE INSERT ON main_table +FOR EACH STATEMENT EXECUTE PROCEDURE trigger_func('before_ins_stmt'); +ERROR: Postgres-XC does not support TRIGGER yet +DETAIL: The feature is not currently supported +CREATE TRIGGER after_ins_stmt_trig AFTER INSERT ON main_table +FOR EACH STATEMENT EXECUTE PROCEDURE trigger_func('after_ins_stmt'); +ERROR: Postgres-XC does not support TRIGGER yet +DETAIL: The feature is not currently supported +-- +-- if neither 'FOR EACH ROW' nor 'FOR EACH STATEMENT' was specified, +-- CREATE TRIGGER should default to 'FOR EACH STATEMENT' +-- +CREATE TRIGGER after_upd_stmt_trig AFTER UPDATE ON main_table +EXECUTE PROCEDURE trigger_func('after_upd_stmt'); +ERROR: Postgres-XC does not support TRIGGER yet +DETAIL: The feature is not currently supported +CREATE TRIGGER after_upd_row_trig AFTER UPDATE ON main_table +FOR EACH ROW EXECUTE PROCEDURE trigger_func('after_upd_row'); +ERROR: Postgres-XC does not support TRIGGER yet +DETAIL: The feature is not currently supported +INSERT INTO main_table DEFAULT VALUES; +UPDATE main_table SET a = a + 1 WHERE b < 30; +ERROR: Partition column can't be updated in current version +-- UPDATE that effects zero rows should still call per-statement trigger +UPDATE main_table SET a = a + 2 WHERE b > 100; +ERROR: Partition column can't be updated in current version +-- COPY should fire per-row and per-statement INSERT triggers +COPY main_table (a, b) FROM stdin; +SELECT * FROM main_table ORDER BY a, b; + a | b +----+---- + 5 | 10 + 20 | 20 + 30 | 10 + 30 | 40 + 50 | 35 + 50 | 60 + 80 | 15 + | +(8 rows) + +-- +-- test triggers with WHEN clause +-- +CREATE TRIGGER modified_a BEFORE UPDATE OF a ON main_table +FOR EACH ROW WHEN (OLD.a <> NEW.a) EXECUTE PROCEDURE trigger_func('modified_a'); +ERROR: Postgres-XC does not support TRIGGER yet +DETAIL: The feature is not currently supported +CREATE TRIGGER modified_any BEFORE UPDATE OF a ON main_table +FOR EACH ROW WHEN (OLD.* IS DISTINCT FROM NEW.*) EXECUTE PROCEDURE trigger_func('modified_any'); +ERROR: Postgres-XC does not support TRIGGER yet +DETAIL: The feature is not currently supported +CREATE TRIGGER insert_a AFTER INSERT ON main_table +FOR EACH ROW WHEN (NEW.a = 123) EXECUTE PROCEDURE trigger_func('insert_a'); +ERROR: Postgres-XC does not support TRIGGER yet +DETAIL: The feature is not currently supported +CREATE TRIGGER delete_a AFTER DELETE ON main_table +FOR EACH ROW WHEN (OLD.a = 123) EXECUTE PROCEDURE trigger_func('delete_a'); +ERROR: Postgres-XC does not support TRIGGER yet +DETAIL: The feature is not currently supported +CREATE TRIGGER insert_when BEFORE INSERT ON main_table +FOR EACH STATEMENT WHEN (true) EXECUTE PROCEDURE trigger_func('insert_when'); +ERROR: Postgres-XC does not support TRIGGER yet +DETAIL: The feature is not currently supported +CREATE TRIGGER delete_when AFTER DELETE ON main_table +FOR EACH STATEMENT WHEN (true) EXECUTE PROCEDURE trigger_func('delete_when'); +ERROR: Postgres-XC does not support TRIGGER yet +DETAIL: The feature is not currently supported +INSERT INTO main_table (a) VALUES (123), (456); +COPY main_table FROM stdin; +DELETE FROM main_table WHERE a IN (123, 456); +UPDATE main_table SET a = 50, b = 60; +ERROR: Partition column can't be updated in current version +SELECT * FROM main_table ORDER BY a, b; + a | b +----+---- + 5 | 10 + 20 | 20 + 30 | 10 + 30 | 40 + 50 | 35 + 50 | 60 + 80 | 15 + | +(8 rows) + +SELECT pg_get_triggerdef(oid, true) FROM pg_trigger WHERE tgrelid = 'main_table'::regclass AND tgname = 'modified_a'; + pg_get_triggerdef +------------------- +(0 rows) + +SELECT pg_get_triggerdef(oid, false) FROM pg_trigger WHERE tgrelid = 'main_table'::regclass AND tgname = 'modified_a'; + pg_get_triggerdef +------------------- +(0 rows) + +SELECT pg_get_triggerdef(oid, true) FROM pg_trigger WHERE tgrelid = 'main_table'::regclass AND tgname = 'modified_any'; + pg_get_triggerdef +------------------- +(0 rows) + +DROP TRIGGER modified_a ON main_table; +ERROR: trigger "modified_a" for table "main_table" does not exist +DROP TRIGGER modified_any ON main_table; +ERROR: trigger "modified_any" for table "main_table" does not exist +DROP TRIGGER insert_a ON main_table; +ERROR: trigger "insert_a" for table "main_table" does not exist +DROP TRIGGER delete_a ON main_table; +ERROR: trigger "delete_a" for table "main_table" does not exist +DROP TRIGGER insert_when ON main_table; +ERROR: trigger "insert_when" for table "main_table" does not exist +DROP TRIGGER delete_when ON main_table; +ERROR: trigger "delete_when" for table "main_table" does not exist +-- Test column-level triggers +DROP TRIGGER after_upd_row_trig ON main_table; +ERROR: trigger "after_upd_row_trig" for table "main_table" does not exist +CREATE TRIGGER before_upd_a_row_trig BEFORE UPDATE OF a ON main_table +FOR EACH ROW EXECUTE PROCEDURE trigger_func('before_upd_a_row'); +ERROR: Postgres-XC does not support TRIGGER yet +DETAIL: The feature is not currently supported +CREATE TRIGGER after_upd_b_row_trig AFTER UPDATE OF b ON main_table +FOR EACH ROW EXECUTE PROCEDURE trigger_func('after_upd_b_row'); +ERROR: Postgres-XC does not support TRIGGER yet +DETAIL: The feature is not currently supported +CREATE TRIGGER after_upd_a_b_row_trig AFTER UPDATE OF a, b ON main_table +FOR EACH ROW EXECUTE PROCEDURE trigger_func('after_upd_a_b_row'); +ERROR: Postgres-XC does not support TRIGGER yet +DETAIL: The feature is not currently supported +CREATE TRIGGER before_upd_a_stmt_trig BEFORE UPDATE OF a ON main_table +FOR EACH STATEMENT EXECUTE PROCEDURE trigger_func('before_upd_a_stmt'); +ERROR: Postgres-XC does not support TRIGGER yet +DETAIL: The feature is not currently supported +CREATE TRIGGER after_upd_b_stmt_trig AFTER UPDATE OF b ON main_table +FOR EACH STATEMENT EXECUTE PROCEDURE trigger_func('after_upd_b_stmt'); +ERROR: Postgres-XC does not support TRIGGER yet +DETAIL: The feature is not currently supported +SELECT pg_get_triggerdef(oid) FROM pg_trigger WHERE tgrelid = 'main_table'::regclass AND tgname = 'after_upd_a_b_row_trig'; + pg_get_triggerdef +------------------- +(0 rows) + +UPDATE main_table SET a = 50; +ERROR: Partition column can't be updated in current version +UPDATE main_table SET b = 10; +-- bogus cases +CREATE TRIGGER error_upd_and_col BEFORE UPDATE OR UPDATE OF a ON main_table +FOR EACH ROW EXECUTE PROCEDURE trigger_func('error_upd_and_col'); +ERROR: duplicate trigger events specified at or near "ON" +LINE 1: ...ER error_upd_and_col BEFORE UPDATE OR UPDATE OF a ON main_ta... + ^ +CREATE TRIGGER error_upd_a_a BEFORE UPDATE OF a, a ON main_table +FOR EACH ROW EXECUTE PROCEDURE trigger_func('error_upd_a_a'); +ERROR: column "a" specified more than once +CREATE TRIGGER error_ins_a BEFORE INSERT OF a ON main_table +FOR EACH ROW EXECUTE PROCEDURE trigger_func('error_ins_a'); +ERROR: syntax error at or near "OF" +LINE 1: CREATE TRIGGER error_ins_a BEFORE INSERT OF a ON main_table + ^ +CREATE TRIGGER error_ins_when BEFORE INSERT OR UPDATE ON main_table +FOR EACH ROW WHEN (OLD.a <> NEW.a) +EXECUTE PROCEDURE trigger_func('error_ins_old'); +ERROR: INSERT trigger's WHEN condition cannot reference OLD values +LINE 2: FOR EACH ROW WHEN (OLD.a <> NEW.a) + ^ +CREATE TRIGGER error_del_when BEFORE DELETE OR UPDATE ON main_table +FOR EACH ROW WHEN (OLD.a <> NEW.a) +EXECUTE PROCEDURE trigger_func('error_del_new'); +ERROR: DELETE trigger's WHEN condition cannot reference NEW values +LINE 2: FOR EACH ROW WHEN (OLD.a <> NEW.a) + ^ +CREATE TRIGGER error_del_when BEFORE INSERT OR UPDATE ON main_table +FOR EACH ROW WHEN (NEW.tableoid <> 0) +EXECUTE PROCEDURE trigger_func('error_when_sys_column'); +ERROR: BEFORE trigger's WHEN condition cannot reference NEW system columns +LINE 2: FOR EACH ROW WHEN (NEW.tableoid <> 0) + ^ +CREATE TRIGGER error_stmt_when BEFORE UPDATE OF a ON main_table +FOR EACH STATEMENT WHEN (OLD.* IS DISTINCT FROM NEW.*) +EXECUTE PROCEDURE trigger_func('error_stmt_when'); +ERROR: statement trigger's WHEN condition cannot reference column values +LINE 2: FOR EACH STATEMENT WHEN (OLD.* IS DISTINCT FROM NEW.*) + ^ +-- check dependency restrictions +ALTER TABLE main_table DROP COLUMN b; +-- this should succeed, but we'll roll it back to keep the triggers around +begin; +DROP TRIGGER after_upd_a_b_row_trig ON main_table; +ERROR: trigger "after_upd_a_b_row_trig" for table "main_table" does not exist +DROP TRIGGER after_upd_b_row_trig ON main_table; +ERROR: current transaction is aborted, commands ignored until end of transaction block +DROP TRIGGER after_upd_b_stmt_trig ON main_table; +ERROR: current transaction is aborted, commands ignored until end of transaction block +ALTER TABLE main_table DROP COLUMN b; +ERROR: current transaction is aborted, commands ignored until end of transaction block +rollback; +-- Test enable/disable triggers +create table trigtest (i serial primary key); +ERROR: Postgres-XC does not support SERIAL yet +DETAIL: The feature is not currently supported +-- test that disabling RI triggers works +create table trigtest2 (i int references trigtest(i) on delete cascade); +ERROR: relation "trigtest" does not exist +create function trigtest() returns trigger as $$ +begin + raise notice '% % % %', TG_RELNAME, TG_OP, TG_WHEN, TG_LEVEL; + return new; +end;$$ language plpgsql; +create trigger trigtest_b_row_tg before insert or update or delete on trigtest +for each row execute procedure trigtest(); +ERROR: relation "trigtest" does not exist +create trigger trigtest_a_row_tg after insert or update or delete on trigtest +for each row execute procedure trigtest(); +ERROR: relation "trigtest" does not exist +create trigger trigtest_b_stmt_tg before insert or update or delete on trigtest +for each statement execute procedure trigtest(); +ERROR: relation "trigtest" does not exist +create trigger trigtest_a_stmt_tg after insert or update or delete on trigtest +for each statement execute procedure trigtest(); +ERROR: relation "trigtest" does not exist +insert into trigtest default values; +ERROR: relation "trigtest" does not exist +LINE 1: insert into trigtest default values; + ^ +alter table trigtest disable trigger trigtest_b_row_tg; +ERROR: relation "trigtest" does not exist +insert into trigtest default values; +ERROR: relation "trigtest" does not exist +LINE 1: insert into trigtest default values; + ^ +alter table trigtest disable trigger user; +ERROR: relation "trigtest" does not exist +insert into trigtest default values; +ERROR: relation "trigtest" does not exist +LINE 1: insert into trigtest default values; + ^ +alter table trigtest enable trigger trigtest_a_stmt_tg; +ERROR: relation "trigtest" does not exist +insert into trigtest default values; +ERROR: relation "trigtest" does not exist +LINE 1: insert into trigtest default values; + ^ +insert into trigtest2 values(1); +ERROR: relation "trigtest2" does not exist +LINE 1: insert into trigtest2 values(1); + ^ +insert into trigtest2 values(2); +ERROR: relation "trigtest2" does not exist +LINE 1: insert into trigtest2 values(2); + ^ +delete from trigtest where i=2; +ERROR: relation "trigtest" does not exist +LINE 1: delete from trigtest where i=2; + ^ +select * from trigtest2 order by 1; +ERROR: relation "trigtest2" does not exist +LINE 1: select * from trigtest2 order by 1; + ^ +alter table trigtest disable trigger all; +ERROR: relation "trigtest" does not exist +delete from trigtest where i=1; +ERROR: relation "trigtest" does not exist +LINE 1: delete from trigtest where i=1; + ^ +select * from trigtest2 order by 1; +ERROR: relation "trigtest2" does not exist +LINE 1: select * from trigtest2 order by 1; + ^ +-- ensure we still insert, even when all triggers are disabled +insert into trigtest default values; +ERROR: relation "trigtest" does not exist +LINE 1: insert into trigtest default values; + ^ +select * from trigtest order by 1; +ERROR: relation "trigtest" does not exist +LINE 1: select * from trigtest order by 1; + ^ +drop table trigtest2; +ERROR: table "trigtest2" does not exist +drop table trigtest; +ERROR: table "trigtest" does not exist +-- dump trigger data +CREATE TABLE trigger_test ( + i int, + v varchar +); +CREATE OR REPLACE FUNCTION trigger_data() RETURNS trigger +LANGUAGE plpgsql AS $$ + +declare + + argstr text; + relid text; + +begin + + relid := TG_relid::regclass; + + -- plpgsql can't discover its trigger data in a hash like perl and python + -- can, or by a sort of reflection like tcl can, + -- so we have to hard code the names. + raise NOTICE 'TG_NAME: %', TG_name; + raise NOTICE 'TG_WHEN: %', TG_when; + raise NOTICE 'TG_LEVEL: %', TG_level; + raise NOTICE 'TG_OP: %', TG_op; + raise NOTICE 'TG_RELID::regclass: %', relid; + raise NOTICE 'TG_RELNAME: %', TG_relname; + raise NOTICE 'TG_TABLE_NAME: %', TG_table_name; + raise NOTICE 'TG_TABLE_SCHEMA: %', TG_table_schema; + raise NOTICE 'TG_NARGS: %', TG_nargs; + + argstr := '['; + for i in 0 .. TG_nargs - 1 loop + if i > 0 then + argstr := argstr || ', '; + end if; + argstr := argstr || TG_argv[i]; + end loop; + argstr := argstr || ']'; + raise NOTICE 'TG_ARGV: %', argstr; + + if TG_OP != 'INSERT' then + raise NOTICE 'OLD: %', OLD; + end if; + + if TG_OP != 'DELETE' then + raise NOTICE 'NEW: %', NEW; + end if; + + if TG_OP = 'DELETE' then + return OLD; + else + return NEW; + end if; + +end; +$$; +CREATE TRIGGER show_trigger_data_trig +BEFORE INSERT OR UPDATE OR DELETE ON trigger_test +FOR EACH ROW EXECUTE PROCEDURE trigger_data(23,'skidoo'); +ERROR: Postgres-XC does not support TRIGGER yet +DETAIL: The feature is not currently supported +insert into trigger_test values(1,'insert'); +update trigger_test set v = 'update' where i = 1; +delete from trigger_test; + +DROP TRIGGER show_trigger_data_trig on trigger_test; +ERROR: trigger "show_trigger_data_trig" for table "trigger_test" does not exist + +DROP FUNCTION trigger_data(); +DROP TABLE trigger_test; +-- +-- Test use of row comparisons on OLD/NEW +-- +CREATE TABLE trigger_test (f1 int, f2 text, f3 text); +-- this is the obvious (and wrong...) way to compare rows +CREATE FUNCTION mytrigger() RETURNS trigger LANGUAGE plpgsql as $$ +begin + if row(old.*) = row(new.*) then + raise notice 'row % not changed', new.f1; + else + raise notice 'row % changed', new.f1; + end if; + return new; +end$$; +CREATE TRIGGER t +BEFORE UPDATE ON trigger_test +FOR EACH ROW EXECUTE PROCEDURE mytrigger(); +ERROR: Postgres-XC does not support TRIGGER yet +DETAIL: The feature is not currently supported +INSERT INTO trigger_test VALUES(1, 'foo', 'bar'); +INSERT INTO trigger_test VALUES(2, 'baz', 'quux'); +UPDATE trigger_test SET f3 = 'bar'; +UPDATE trigger_test SET f3 = NULL; +-- this demonstrates that the above isn't really working as desired: +UPDATE trigger_test SET f3 = NULL; +-- the right way when considering nulls is +CREATE OR REPLACE FUNCTION mytrigger() RETURNS trigger LANGUAGE plpgsql as $$ +begin + if row(old.*) is distinct from row(new.*) then + raise notice 'row % changed', new.f1; + else + raise notice 'row % not changed', new.f1; + end if; + return new; +end$$; +UPDATE trigger_test SET f3 = 'bar'; +UPDATE trigger_test SET f3 = NULL; +UPDATE trigger_test SET f3 = NULL; +DROP TABLE trigger_test; +DROP FUNCTION mytrigger(); +-- Test snapshot management in serializable transactions involving triggers +-- per bug report in 6bc...@ma... +CREATE FUNCTION serializable_update_trig() RETURNS trigger LANGUAGE plpgsql AS +$$ +declare + rec record; +begin + new.description = 'updated in trigger'; + return new; +end; +$$; +CREATE TABLE serializable_update_tab ( + id int, + filler text, + description text +); +CREATE TRIGGER serializable_update_trig BEFORE UPDATE ON serializable_update_tab + FOR EACH ROW EXECUTE PROCEDURE serializable_update_trig(); +ERROR: Postgres-XC does not support TRIGGER yet +DETAIL: The feature is not currently supported +INSERT INTO serializable_update_tab SELECT a, repeat('xyzxz', 100), 'new' + FROM generate_series(1, 50) a; +BEGIN; +SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; +UPDATE serializable_update_tab SET description = 'no no', id = 1 WHERE id = 1; +ERROR: Partition column can't be updated in current version +COMMIT; +SELECT description FROM serializable_update_tab WHERE id = 1; + description +------------- +(0 rows) + +DROP TABLE serializable_update_tab; +-- minimal update trigger +CREATE TABLE min_updates_test ( + f1 text, + f2 int, + f3 int); +CREATE TABLE min_updates_test_oids ( + f1 text, + f2 int, + f3 int) WITH OIDS; +INSERT INTO min_updates_test VALUES ('a',1,2),('b','2',null); +INSERT INTO min_updates_test_oids VALUES ('a',1,2),('b','2',null); +CREATE TRIGGER z_min_update +BEFORE UPDATE ON min_updates_test +FOR EACH ROW EXECUTE PROCEDURE suppress_redundant_updates_trigger(); +ERROR: Postgres-XC does not support TRIGGER yet +DETAIL: The feature is not currently supported +CREATE TRIGGER z_min_update +BEFORE UPDATE ON min_updates_test_oids +FOR EACH ROW EXECUTE PROCEDURE suppress_redundant_updates_trigger(); +ERROR: Postgres-XC does not support TRIGGER yet +DETAIL: The feature is not currently supported +\set QUIET false +UPDATE min_updates_test SET f1 = f1; +UPDATE 2 +UPDATE min_updates_test SET f2 = f2 + 1; +ERROR: Partition column can't be updated in current version +UPDATE min_updates_test SET f3 = 2 WHERE f3 is null; +UPDATE 1 +UPDATE min_updates_test_oids SET f1 = f1; +UPDATE 2 +UPDATE min_updates_test_oids SET f2 = f2 + 1; +ERROR: Partition column can't be updated in current version +UPDATE min_updates_test_oids SET f3 = 2 WHERE f3 is null; +UPDATE 1 +\set QUIET true +SELECT * FROM min_updates_test ORDER BY 1,2,3; + f1 | f2 | f3 +----+----+---- + a | 1 | 2 + b | 2 | 2 +(2 rows) + +SELECT * FROM min_updates_test_oids ORDER BY 1,2,3; + f1 | f2 | f3 +----+----+---- + a | 1 | 2 + b | 2 | 2 +(2 rows) + +DROP TABLE min_updates_test; +DROP TABLE min_updates_test_oids; ----------------------------------------------------------------------- Summary of changes: .../expected/{triggers.out => triggers_1.out} | 406 +++++++++----------- 1 files changed, 180 insertions(+), 226 deletions(-) copy src/test/regress/expected/{triggers.out => triggers_1.out} (61%) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-03-22 14:47:45
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via b8593ff58077e29c21c5f1ed50e622b0cf882b8c (commit) from 171d5e3b22a1b5b15ad09712fe829d8bf61e3d13 (commit) - Log ----------------------------------------------------------------- commit b8593ff58077e29c21c5f1ed50e622b0cf882b8c Author: Michael P <mic...@us...> Date: Tue Mar 22 23:46:22 2011 +0900 Fix for regression test box box is not a type that can use ORDER BY, so its table is replicated for regression tests diff --git a/src/test/regress/expected/box_1.out b/src/test/regress/expected/box_1.out index 7bd428a..7ff6017 100644 --- a/src/test/regress/expected/box_1.out +++ b/src/test/regress/expected/box_1.out @@ -15,7 +15,9 @@ -- 0 1 2 3 -- -- boxes are specified by two points, given by four floats x1,y1,x2,y2 -CREATE TABLE BOX_TBL (f1 box); +-- Postgres-XC case: box type cannot use ORDER BY so its table +-- is replicated for regression tests +CREATE TABLE BOX_TBL (f1 box) DISTRIBUTE BY REPLICATION; 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 @@ -34,10 +36,10 @@ 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) + | (3,3),(1,1) | (2.5,3.5),(2.5,2.5) + | (3,3),(3,3) (4 rows) SELECT '' AS four, b.*, area(b.f1) as barea diff --git a/src/test/regress/sql/box.sql b/src/test/regress/sql/box.sql index baf86ae..8c17383 100644 --- a/src/test/regress/sql/box.sql +++ b/src/test/regress/sql/box.sql @@ -18,8 +18,9 @@ -- boxes are specified by two points, given by four floats x1,y1,x2,y2 - -CREATE TABLE BOX_TBL (f1 box); +-- Postgres-XC case: box type cannot use ORDER BY so its table +-- is replicated for regression tests +CREATE TABLE BOX_TBL (f1 box) DISTRIBUTE BY REPLICATION; INSERT INTO BOX_TBL (f1) VALUES ('(2.0,2.0,0.0,0.0)'); ----------------------------------------------------------------------- Summary of changes: src/test/regress/expected/box_1.out | 8 +++++--- src/test/regress/sql/box.sql | 5 +++-- 2 files changed, 8 insertions(+), 5 deletions(-) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-03-22 13:57:51
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via 171d5e3b22a1b5b15ad09712fe829d8bf61e3d13 (commit) from 33b9889d7cc947a702f2d4ff7cb147abdd606666 (commit) - Log ----------------------------------------------------------------- commit 171d5e3b22a1b5b15ad09712fe829d8bf61e3d13 Author: Michael P <mic...@us...> Date: Tue Mar 22 22:55:37 2011 +0900 Fix for regression test point point is a type that cannot be ordered with ORDER BY, so create its table as DISTRIBUTE BY REPLICATION for regressions. diff --git a/src/test/regress/expected/point_1.out b/src/test/regress/expected/point_1.out new file mode 100644 index 0000000..472930c --- /dev/null +++ b/src/test/regress/expected/point_1.out @@ -0,0 +1,249 @@ +-- +-- POINT +-- +-- Postgres-XC case: point type cannot be ordered so table +-- is replicated for regression tests whatever the cluster configuration +CREATE TABLE POINT_TBL(f1 point) DISTRIBUTE BY REPLICATION; +INSERT INTO POINT_TBL(f1) VALUES ('(0.0,0.0)'); +INSERT INTO POINT_TBL(f1) VALUES ('(-10.0,0.0)'); +INSERT INTO POINT_TBL(f1) VALUES ('(-3.0,4.0)'); +INSERT INTO POINT_TBL(f1) VALUES ('(5.1, 34.5)'); +INSERT INTO POINT_TBL(f1) VALUES ('(-5.0,-12.0)'); +-- bad format points +INSERT INTO POINT_TBL(f1) VALUES ('asdfasdf'); +ERROR: invalid input syntax for type point: "asdfasdf" +LINE 1: INSERT INTO POINT_TBL(f1) VALUES ('asdfasdf'); + ^ +INSERT INTO POINT_TBL(f1) VALUES ('10.0,10.0'); +INSERT INTO POINT_TBL(f1) VALUES ('(10.0 10.0)'); +ERROR: invalid input syntax for type point: "(10.0 10.0)" +LINE 1: INSERT INTO POINT_TBL(f1) VALUES ('(10.0 10.0)'); + ^ +INSERT INTO POINT_TBL(f1) VALUES ('(10.0,10.0'); +ERROR: invalid input syntax for type point: "(10.0,10.0" +LINE 1: INSERT INTO POINT_TBL(f1) VALUES ('(10.0,10.0'); + ^ +SELECT '' AS six, * FROM POINT_TBL; + six | f1 +-----+------------ + | (0,0) + | (-10,0) + | (-3,4) + | (5.1,34.5) + | (-5,-12) + | (10,10) +(6 rows) + +-- left of +SELECT '' AS three, p.* FROM POINT_TBL p WHERE p.f1 << '(0.0, 0.0)' ORDER BY p.f1[0], p.f1[1]; + three | f1 +-------+---------- + | (-10,0) + | (-5,-12) + | (-3,4) +(3 rows) + +-- right of +SELECT '' AS three, p.* FROM POINT_TBL p WHERE '(0.0,0.0)' >> p.f1 ORDER BY p.f1[0], p.f1[1]; + three | f1 +-------+---------- + | (-10,0) + | (-5,-12) + | (-3,4) +(3 rows) + +-- above +SELECT '' AS one, p.* FROM POINT_TBL p WHERE '(0.0,0.0)' >^ p.f1 ORDER BY p.f1[0], p.f1[1]; + one | f1 +-----+---------- + | (-5,-12) +(1 row) + +-- below +SELECT '' AS one, p.* FROM POINT_TBL p WHERE p.f1 <^ '(0.0, 0.0)' ORDER BY p.f1[0], p.f1[1]; + one | f1 +-----+---------- + | (-5,-12) +(1 row) + +-- equal +SELECT '' AS one, p.* FROM POINT_TBL p WHERE p.f1 ~= '(5.1, 34.5)' ORDER BY p.f1[0], p.f1[1]; + one | f1 +-----+------------ + | (5.1,34.5) +(1 row) + +-- point in box +SELECT '' AS three, p.* FROM POINT_TBL p + WHERE p.f1 <@ box '(0,0,100,100)' ORDER BY p.f1[0], p.f1[1]; + three | f1 +-------+------------ + | (0,0) + | (5.1,34.5) + | (10,10) +(3 rows) + +SELECT '' AS three, p.* FROM POINT_TBL p + WHERE box '(0,0,100,100)' @> p.f1; + three | f1 +-------+------------ + | (0,0) + | (5.1,34.5) + | (10,10) +(3 rows) + +SELECT '' AS three, p.* FROM POINT_TBL p + WHERE not p.f1 <@ box '(0,0,100,100)'; + three | f1 +-------+---------- + | (-10,0) + | (-3,4) + | (-5,-12) +(3 rows) + +SELECT '' AS two, p.* FROM POINT_TBL p + WHERE p.f1 <@ path '[(0,0),(-10,0),(-10,10)]' ORDER BY p.f1[0], p.f1[1]; + two | f1 +-----+--------- + | (-10,0) + | (0,0) +(2 rows) + +SELECT '' AS three, p.* FROM POINT_TBL p + WHERE not box '(0,0,100,100)' @> p.f1; + three | f1 +-------+---------- + | (-10,0) + | (-3,4) + | (-5,-12) +(3 rows) + +SELECT '' AS six, p.f1, p.f1 <-> point '(0,0)' AS dist + FROM POINT_TBL p + ORDER BY dist, p.f1[0], p.f1[1]; + six | f1 | dist +-----+------------+------------------ + | (0,0) | 0 + | (-3,4) | 5 + | (-10,0) | 10 + | (-5,-12) | 13 + | (10,10) | 14.142135623731 + | (5.1,34.5) | 34.8749193547455 +(6 rows) + +SELECT '' AS thirtysix, p1.f1 AS point1, p2.f1 AS point2, p1.f1 <-> p2.f1 AS dist + FROM POINT_TBL p1, POINT_TBL p2 + ORDER BY dist, p1.f1[0], p2.f1[0]; + thirtysix | point1 | point2 | dist +-----------+------------+------------+------------------ + | (-10,0) | (-10,0) | 0 + | (-5,-12) | (-5,-12) | 0 + | (-3,4) | (-3,4) | 0 + | (0,0) | (0,0) | 0 + | (5.1,34.5) | (5.1,34.5) | 0 + | (10,10) | (10,10) | 0 + | (-3,4) | (0,0) | 5 + | (0,0) | (-3,4) | 5 + | (-10,0) | (-3,4) | 8.06225774829855 + | (-3,4) | (-10,0) | 8.06225774829855 + | (-10,0) | (0,0) | 10 + | (0,0) | (-10,0) | 10 + | (-10,0) | (-5,-12) | 13 + | (-5,-12) | (-10,0) | 13 + | (-5,-12) | (0,0) | 13 + | (0,0) | (-5,-12) | 13 + | (0,0) | (10,10) | 14.142135623731 + | (10,10) | (0,0) | 14.142135623731 + | (-3,4) | (10,10) | 14.3178210632764 + | (10,10) | (-3,4) | 14.3178210632764 + | (-5,-12) | (-3,4) | 16.1245154965971 + | (-3,4) | (-5,-12) | 16.1245154965971 + | (-10,0) | (10,10) | 22.3606797749979 + | (10,10) | (-10,0) | 22.3606797749979 + | (5.1,34.5) | (10,10) | 24.9851956166046 + | (10,10) | (5.1,34.5) | 24.9851956166046 + | (-5,-12) | (10,10) | 26.6270539113887 + | (10,10) | (-5,-12) | 26.6270539113887 + | (-3,4) | (5.1,34.5) | 31.5572495632937 + | (5.1,34.5) | (-3,4) | 31.5572495632937 + | (0,0) | (5.1,34.5) | 34.8749193547455 + | (5.1,34.5) | (0,0) | 34.8749193547455 + | (-10,0) | (5.1,34.5) | 37.6597928831267 + | (5.1,34.5) | (-10,0) | 37.6597928831267 + | (-5,-12) | (5.1,34.5) | 47.5842410888311 + | (5.1,34.5) | (-5,-12) | 47.5842410888311 +(36 rows) + +SELECT '' AS thirty, p1.f1 AS point1, p2.f1 AS point2 + FROM POINT_TBL p1, POINT_TBL p2 + WHERE (p1.f1 <-> p2.f1) > 3 ORDER BY p1.f1[0], p1.f1[1], p2.f1[0], p2.f1[1]; + thirty | point1 | point2 +--------+------------+------------ + | (-10,0) | (-5,-12) + | (-10,0) | (-3,4) + | (-10,0) | (0,0) + | (-10,0) | (5.1,34.5) + | (-10,0) | (10,10) + | (-5,-12) | (-10,0) + | (-5,-12) | (-3,4) + | (-5,-12) | (0,0) + | (-5,-12) | (5.1,34.5) + | (-5,-12) | (10,10) + | (-3,4) | (-10,0) + | (-3,4) | (-5,-12) + | (-3,4) | (0,0) + | (-3,4) | (5.1,34.5) + | (-3,4) | (10,10) + | (0,0) | (-10,0) + | (0,0) | (-5,-12) + | (0,0) | (-3,4) + | (0,0) | (5.1,34.5) + | (0,0) | (10,10) + | (5.1,34.5) | (-10,0) + | (5.1,34.5) | (-5,-12) + | (5.1,34.5) | (-3,4) + | (5.1,34.5) | (0,0) + | (5.1,34.5) | (10,10) + | (10,10) | (-10,0) + | (10,10) | (-5,-12) + | (10,10) | (-3,4) + | (10,10) | (0,0) + | (10,10) | (5.1,34.5) +(30 rows) + +-- put distance result into output to allow sorting with GEQ optimizer - tgl 97/05/10 +SELECT '' AS fifteen, p1.f1 AS point1, p2.f1 AS point2, (p1.f1 <-> p2.f1) AS distance + FROM POINT_TBL p1, POINT_TBL p2 + WHERE (p1.f1 <-> p2.f1) > 3 and p1.f1 << p2.f1 + ORDER BY distance, p1.f1[0], p2.f1[0]; + fifteen | point1 | point2 | distance +---------+------------+------------+------------------ + | (-3,4) | (0,0) | 5 + | (-10,0) | (-3,4) | 8.06225774829855 + | (-10,0) | (0,0) | 10 + | (-10,0) | (-5,-12) | 13 + | (-5,-12) | (0,0) | 13 + | (0,0) | (10,10) | 14.142135623731 + | (-3,4) | (10,10) | 14.3178210632764 + | (-5,-12) | (-3,4) | 16.1245154965971 + | (-10,0) | (10,10) | 22.3606797749979 + | (5.1,34.5) | (10,10) | 24.9851956166046 + | (-5,-12) | (10,10) | 26.6270539113887 + | (-3,4) | (5.1,34.5) | 31.5572495632937 + | (0,0) | (5.1,34.5) | 34.8749193547455 + | (-10,0) | (5.1,34.5) | 37.6597928831267 + | (-5,-12) | (5.1,34.5) | 47.5842410888311 +(15 rows) + +-- put distance result into output to allow sorting with GEQ optimizer - tgl 97/05/10 +SELECT '' AS three, p1.f1 AS point1, p2.f1 AS point2, (p1.f1 <-> p2.f1) AS distance + FROM POINT_TBL p1, POINT_TBL p2 + WHERE (p1.f1 <-> p2.f1) > 3 and p1.f1 << p2.f1 and p1.f1 >^ p2.f1 + ORDER BY distance, p1.f1[0], p1.f1[1], p2.f1[0], p2.f1[1]; + three | point1 | point2 | distance +-------+------------+----------+------------------ + | (-3,4) | (0,0) | 5 + | (-10,0) | (-5,-12) | 13 + | (5.1,34.5) | (10,10) | 24.9851956166046 +(3 rows) + diff --git a/src/test/regress/sql/point.sql b/src/test/regress/sql/point.sql index f991b4a..faa6b9e 100644 --- a/src/test/regress/sql/point.sql +++ b/src/test/regress/sql/point.sql @@ -2,7 +2,9 @@ -- POINT -- -CREATE TABLE POINT_TBL(f1 point); +-- Postgres-XC case: point type cannot use ORDER BY so table +-- is replicated for regression tests whatever the cluster configuration +CREATE TABLE POINT_TBL(f1 point) DISTRIBUTE BY REPLICATION; INSERT INTO POINT_TBL(f1) VALUES ('(0.0,0.0)'); ----------------------------------------------------------------------- Summary of changes: .../regress/expected/{point.out => point_1.out} | 8 +++++--- src/test/regress/sql/point.sql | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) copy src/test/regress/expected/{point.out => point_1.out} (97%) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-03-22 13:40:46
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via 33b9889d7cc947a702f2d4ff7cb147abdd606666 (commit) from f8d599dc12fe06669f4aadc5dddda3fc2c1109b8 (commit) - Log ----------------------------------------------------------------- commit 33b9889d7cc947a702f2d4ff7cb147abdd606666 Author: Michael P <mic...@us...> Date: Tue Mar 22 22:39:33 2011 +0900 Fix for regression test tablespace Correct output file used as source. diff --git a/src/test/regress/expected/tablespace_1.out b/src/test/regress/output/tablespace_1.source similarity index 97% rename from src/test/regress/expected/tablespace_1.out rename to src/test/regress/output/tablespace_1.source index 725ad23..18bd4d1 100644 --- a/src/test/regress/expected/tablespace_1.out +++ b/src/test/regress/output/tablespace_1.source @@ -1,5 +1,5 @@ -- create a tablespace we can use -CREATE TABLESPACE testspace LOCATION '/home/abbas/pgxc/postgres-xc/src/test/regress/testtablespace'; +CREATE TABLESPACE testspace LOCATION '@testtablespace@'; ERROR: Postgres-XC does not support TABLESPACE yet DETAIL: The feature is not currently supported -- try setting and resetting some properties for the new tablespace ----------------------------------------------------------------------- Summary of changes: .../tablespace_1.source} | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) rename src/test/regress/{expected/tablespace_1.out => output/tablespace_1.source} (97%) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-03-22 09:46:25
|
Project "Postgres-XC". The branch, ha_support has been updated via 4d3f0a48a979044c6b741f9cd7d4dc37c32548e2 (commit) via 490c08dd37fa44af57cd3a2b3e931ef4f3a94853 (commit) from 5aec41aca3a30aa21948daa4326465fc1157023f (commit) - Log ----------------------------------------------------------------- commit 4d3f0a48a979044c6b741f9cd7d4dc37c32548e2 Merge: 5aec41a 490c08d Author: Michael P <mic...@us...> Date: Tue Mar 22 18:43:21 2011 +0900 Merge branch 'master' into ha_support ----------------------------------------------------------------------- Summary of changes: src/backend/Makefile | 2 - src/bin/initdb/initdb.c | 28 ------------ src/bin/scripts/Makefile | 2 - src/pgxc/bin/pgxc_ddl/README | 47 ++++++++++++++++++++ .../misc => pgxc/bin/pgxc_ddl}/pgxc.conf.sample | 0 src/{bin/scripts => pgxc/bin/pgxc_ddl}/pgxc_ddl | 0 6 files changed, 47 insertions(+), 32 deletions(-) create mode 100644 src/pgxc/bin/pgxc_ddl/README rename src/{backend/utils/misc => pgxc/bin/pgxc_ddl}/pgxc.conf.sample (100%) rename src/{bin/scripts => pgxc/bin/pgxc_ddl}/pgxc_ddl (100%) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-03-22 09:42:39
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via f8d599dc12fe06669f4aadc5dddda3fc2c1109b8 (commit) via 490c08dd37fa44af57cd3a2b3e931ef4f3a94853 (commit) from 55433e8be6a7b51568e4d727605b45e911c19f75 (commit) - Log ----------------------------------------------------------------- commit f8d599dc12fe06669f4aadc5dddda3fc2c1109b8 Merge: 55433e8 490c08d Author: Michael P <mic...@us...> Date: Tue Mar 22 18:29:42 2011 +0900 Merge branch 'master' into merge_postgres_9_0_3 Conflicts: src/backend/Makefile src/bin/scripts/Makefile diff --cc src/backend/Makefile index 23a9181,10e67c6..218639d --- a/src/backend/Makefile +++ b/src/backend/Makefile @@@ -283,13 -247,11 +280,12 @@@ endi endif $(MAKE) -C catalog uninstall-data $(MAKE) -C tsearch uninstall-data +# PGXC BEGIN rm -f '$(DESTDIR)$(datadir)/pg_hba.conf.sample' \ - '$(DESTDIR)$(datadir)/pgxc.conf.sample' \ '$(DESTDIR)$(datadir)/pg_ident.conf.sample' \ - '$(DESTDIR)$(datadir)/postgresql.conf.sample' \ + '$(DESTDIR)$(datadir)/postgresql.conf.sample' \ '$(DESTDIR)$(datadir)/recovery.conf.sample' - +# PGXC END ########################################################################## diff --cc src/bin/scripts/Makefile index 87430d2,c28a066..4248f3b --- a/src/bin/scripts/Makefile +++ b/src/bin/scripts/Makefile @@@ -54,12 -52,9 +54,9 @@@ install: all installdir $(INSTALL_PROGRAM) clusterdb$(X) '$(DESTDIR)$(bindir)'/clusterdb$(X) $(INSTALL_PROGRAM) vacuumdb$(X) '$(DESTDIR)$(bindir)'/vacuumdb$(X) $(INSTALL_PROGRAM) reindexdb$(X) '$(DESTDIR)$(bindir)'/reindexdb$(X) - # PGXC_BEGIN - $(INSTALL_PROGRAM) pgxc_ddl$(X) '$(DESTDIR)$(bindir)'/pgxc_ddl$(X) - chmod 555 '$(DESTDIR)$(bindir)'/pgxc_ddl$(X) - # PGXC_END + installdirs: - $(mkinstalldirs) '$(DESTDIR)$(bindir)' + $(MKDIR_P) '$(DESTDIR)$(bindir)' uninstall: rm -f $(addprefix '$(DESTDIR)$(bindir)'/, $(addsuffix $(X), $(PROGRAMS))) ----------------------------------------------------------------------- Summary of changes: src/backend/Makefile | 4 -- src/bin/initdb/initdb.c | 28 ------------ src/bin/scripts/Makefile | 5 +-- src/pgxc/bin/pgxc_ddl/README | 47 ++++++++++++++++++++ .../misc => pgxc/bin/pgxc_ddl}/pgxc.conf.sample | 0 src/{bin/scripts => pgxc/bin/pgxc_ddl}/pgxc_ddl | 0 6 files changed, 48 insertions(+), 36 deletions(-) create mode 100644 src/pgxc/bin/pgxc_ddl/README rename src/{backend/utils/misc => pgxc/bin/pgxc_ddl}/pgxc.conf.sample (100%) rename src/{bin/scripts => pgxc/bin/pgxc_ddl}/pgxc_ddl (100%) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-03-22 09:24:24
|
Project "Postgres-XC". The branch, master has been updated via 490c08dd37fa44af57cd3a2b3e931ef4f3a94853 (commit) from fbb0afd7b8858b13dc1f1f212742ffafcf4b7d8f (commit) - Log ----------------------------------------------------------------- commit 490c08dd37fa44af57cd3a2b3e931ef4f3a94853 Author: Michael P <mic...@us...> Date: Tue Mar 22 18:04:21 2011 +0900 Clean up of pgxc_ddl This script was used up to version 0.9.2 to make a cold synchronization of Coordinator catalogs when running a DDL. At this point, it was necessary to stop the cluster each time a DDL was launched, resulting in an unefficient process. This commit removes the dependencies between pgxc_ddl and XC (initdb). It is now not installed by default and moved to a new repository called src/pgxc/bin/pgxc_ddl. A README is also added. diff --git a/src/backend/Makefile b/src/backend/Makefile index 984c951..10e67c6 100644 --- a/src/backend/Makefile +++ b/src/backend/Makefile @@ -195,7 +195,6 @@ endif $(INSTALL_DATA) $(srcdir)/libpq/pg_hba.conf.sample '$(DESTDIR)$(datadir)/pg_hba.conf.sample' $(INSTALL_DATA) $(srcdir)/libpq/pg_ident.conf.sample '$(DESTDIR)$(datadir)/pg_ident.conf.sample' $(INSTALL_DATA) $(srcdir)/utils/misc/postgresql.conf.sample '$(DESTDIR)$(datadir)/postgresql.conf.sample' - $(INSTALL_DATA) $(srcdir)/utils/misc/pgxc.conf.sample '$(DESTDIR)$(datadir)/pgxc.conf.sample' $(INSTALL_DATA) $(srcdir)/access/transam/recovery.conf.sample '$(DESTDIR)$(datadir)/recovery.conf.sample' install-bin: postgres $(POSTGRES_IMP) installdirs @@ -249,7 +248,6 @@ endif $(MAKE) -C catalog uninstall-data $(MAKE) -C tsearch uninstall-data rm -f '$(DESTDIR)$(datadir)/pg_hba.conf.sample' \ - '$(DESTDIR)$(datadir)/pgxc.conf.sample' \ '$(DESTDIR)$(datadir)/pg_ident.conf.sample' \ '$(DESTDIR)$(datadir)/postgresql.conf.sample' \ '$(DESTDIR)$(datadir)/recovery.conf.sample' diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c index 67aa3e5..00c4126 100644 --- a/src/bin/initdb/initdb.c +++ b/src/bin/initdb/initdb.c @@ -100,9 +100,6 @@ static char *shdesc_file; static char *hba_file; static char *ident_file; static char *conf_file; -#ifdef PGXC -static char *pgxc_conf_file; -#endif static char *conversion_file; static char *dictionary_file; static char *info_schema_file; @@ -1299,19 +1296,6 @@ setup_config(void) free(conflines); -#ifdef PGXC - /* pgxc.conf */ - - conflines = readfile(pgxc_conf_file); - - snprintf(path, sizeof(path), "%s/pgxc.conf", pg_data); - - writefile(path, conflines); - chmod(path, 0600); - - free(conflines); -#endif - check_ok(); } @@ -2826,9 +2810,6 @@ main(int argc, char *argv[]) set_input(&hba_file, "pg_hba.conf.sample"); set_input(&ident_file, "pg_ident.conf.sample"); set_input(&conf_file, "postgresql.conf.sample"); -#ifdef PGXC - set_input(&pgxc_conf_file, "pgxc.conf.sample"); -#endif set_input(&conversion_file, "conversion_create.sql"); set_input(&dictionary_file, "snowball_create.sql"); set_input(&info_schema_file, "information_schema.sql"); @@ -2845,18 +2826,12 @@ main(int argc, char *argv[]) "POSTGRES_SUPERUSERNAME=%s\nPOSTGRES_BKI=%s\n" "POSTGRES_DESCR=%s\nPOSTGRES_SHDESCR=%s\n" "POSTGRESQL_CONF_SAMPLE=%s\n" -#ifdef PGXC - "PGXC_CONF_SAMPLE=%s\n" -#endif "PG_HBA_SAMPLE=%s\nPG_IDENT_SAMPLE=%s\n", PG_VERSION, pg_data, share_path, bin_path, username, bki_file, desc_file, shdesc_file, conf_file, -#ifdef PGXC - pgxc_conf_file, -#endif hba_file, ident_file); if (show_setting) exit(0); @@ -2867,9 +2842,6 @@ main(int argc, char *argv[]) check_input(shdesc_file); check_input(hba_file); check_input(ident_file); -#ifdef PGXC - check_input(pgxc_conf_file); -#endif check_input(conf_file); check_input(conversion_file); check_input(dictionary_file); diff --git a/src/bin/scripts/Makefile b/src/bin/scripts/Makefile index 48f9c20..c28a066 100644 --- a/src/bin/scripts/Makefile +++ b/src/bin/scripts/Makefile @@ -52,8 +52,6 @@ install: all installdirs $(INSTALL_PROGRAM) clusterdb$(X) '$(DESTDIR)$(bindir)'/clusterdb$(X) $(INSTALL_PROGRAM) vacuumdb$(X) '$(DESTDIR)$(bindir)'/vacuumdb$(X) $(INSTALL_PROGRAM) reindexdb$(X) '$(DESTDIR)$(bindir)'/reindexdb$(X) - $(INSTALL_PROGRAM) pgxc_ddl$(X) '$(DESTDIR)$(bindir)'/pgxc_ddl$(X) - chmod 555 '$(DESTDIR)$(bindir)'/pgxc_ddl$(X) installdirs: $(mkinstalldirs) '$(DESTDIR)$(bindir)' diff --git a/src/pgxc/bin/pgxc_ddl/README b/src/pgxc/bin/pgxc_ddl/README new file mode 100644 index 0000000..0a2c440 --- /dev/null +++ b/src/pgxc/bin/pgxc_ddl/README @@ -0,0 +1,47 @@ +Postgres-XC - pgxc_ddl +===================================== + +This directory contains pgxc_ddl, an application used to make a cold synchronization of DDL +in a Postgres-XC cluster by launching DDL and then copy Coordinator catalog file +data from a remote Coordinator (where DDL has been launched) to other Coordinators. + +pgxc_ddl can also be used to synchronize catalog files. + +pgxc_ddl was put in the default install repository before DDL synchronizing was implemented +(prior to version Postgres-XC 0.9.3). + +pgxc_ddl can be used with a configuration file called pgxc.conf. +This file is kept with the name pgxc.conf.sample to stick with PostgreSQL format. +Up to v0.9.3, pgxc.conf was by default installed by initdb in a data folder, +but this is not really necessary since DDL Synchronization is implemented in Postgres-XC. + +So it is kept in a separate repository src/pgxc/bin/pgxc_ddl/. + +===================================== +pgxc_ddl +===================================== +This script uses the following options: +- D to locate the data folder, necessary to find pgxc.conf, + containing the characteristics of all the coordinators +- l to locate the folder where applications are +- f for a DDL file used as input +- d for a Database name on which to launch DDL +- n coordinator number where to launch DDL, + number based on the one written in pgxc.conf +- t base name of folder where to save configuration files, + by default /tmp/pgxc_config, completed by $$ (process number for folder name uniqueness) + +===================================== +pgxc.conf.sample +===================================== +Same format as for GUC files is used. + +This configuration file contains the list of following parameters: +- coordinator_hosts, list of Coordinator hosts + This is an array and format is 'host_name_1,host_name_2'. +- coordinator_ports, list of Coordinator ports + This is an array and format is 'port_1,port_2' +- coordinator_folders + This is an array and format is 'data_folder_1,data_folder_2' + +All the arrays need to have the same size equal to the number of Coordinators. diff --git a/src/backend/utils/misc/pgxc.conf.sample b/src/pgxc/bin/pgxc_ddl/pgxc.conf.sample similarity index 100% rename from src/backend/utils/misc/pgxc.conf.sample rename to src/pgxc/bin/pgxc_ddl/pgxc.conf.sample diff --git a/src/bin/scripts/pgxc_ddl b/src/pgxc/bin/pgxc_ddl/pgxc_ddl similarity index 100% rename from src/bin/scripts/pgxc_ddl rename to src/pgxc/bin/pgxc_ddl/pgxc_ddl ----------------------------------------------------------------------- Summary of changes: src/backend/Makefile | 2 - src/bin/initdb/initdb.c | 28 ------------ src/bin/scripts/Makefile | 2 - src/pgxc/bin/pgxc_ddl/README | 47 ++++++++++++++++++++ .../misc => pgxc/bin/pgxc_ddl}/pgxc.conf.sample | 0 src/{bin/scripts => pgxc/bin/pgxc_ddl}/pgxc_ddl | 0 6 files changed, 47 insertions(+), 32 deletions(-) create mode 100644 src/pgxc/bin/pgxc_ddl/README rename src/{backend/utils/misc => pgxc/bin/pgxc_ddl}/pgxc.conf.sample (100%) rename src/{bin/scripts => pgxc/bin/pgxc_ddl}/pgxc_ddl (100%) hooks/post-receive -- Postgres-XC |