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
(2) |
2
(3) |
3
|
4
(2) |
5
(3) |
6
(2) |
7
(8) |
8
(12) |
9
|
10
|
11
(17) |
12
(16) |
13
(4) |
14
(3) |
15
(5) |
16
|
17
|
18
(1) |
19
(3) |
20
(2) |
21
(1) |
22
(1) |
23
|
24
|
25
(3) |
26
(1) |
27
|
28
|
29
|
30
|
From: Michael P. <mic...@us...> - 2011-04-11 23:19:09
|
Project "Postgres-XC". The branch, master has been updated via 7f0ec79b75ca3836569d6a60cedc55665d74ec20 (commit) from dc2762989aaf0946219444d81b12222ac3b553a0 (commit) - Log ----------------------------------------------------------------- commit 7f0ec79b75ca3836569d6a60cedc55665d74ec20 Author: Michael P <mic...@us...> Date: Tue Apr 12 08:14:16 2011 +0900 Remove unnecessary output file. In regression results, copy_2.out was identical to copy_1.out diff --git a/src/test/regress/expected/copy_2.out b/src/test/regress/expected/copy_2.out deleted file mode 100644 index 80a0ea4..0000000 --- a/src/test/regress/expected/copy_2.out +++ /dev/null @@ -1,99 +0,0 @@ --- --- COPY --- --- CLASS POPULATION --- (any resemblance to real life is purely coincidental) --- -COPY aggtest FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/agg.data'; -COPY onek FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/onek.data'; -COPY onek TO '/home/abbas/pgxc/postgres-xc/src/test/regress/results/onek.data'; -DELETE FROM onek; -COPY onek FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/results/onek.data'; -COPY tenk1 FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/tenk.data'; -COPY slow_emp4000 FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/rect.data'; -COPY person FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/person.data'; -COPY emp FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/emp.data'; -COPY student FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/student.data'; -COPY stud_emp FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/stud_emp.data'; -COPY road FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/streets.data'; -COPY real_city FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/real_city.data'; -COPY hash_i4_heap FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/hash.data'; -COPY hash_name_heap FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/hash.data'; -COPY hash_txt_heap FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/hash.data'; -COPY hash_f8_heap FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/hash.data'; -COPY test_tsvector FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/tsearch.data'; --- the data in this file has a lot of duplicates in the index key --- fields, leading to long bucket chains and lots of table expansion. --- this is therefore a stress test of the bucket overflow code (unlike --- the data in hash.data, which has unique index keys). --- --- COPY hash_ovfl_heap FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/hashovfl.data'; -COPY bt_i4_heap FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/desc.data'; -COPY bt_name_heap FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/hash.data'; -COPY bt_txt_heap FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/desc.data'; -COPY bt_f8_heap FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/hash.data'; -COPY array_op_test FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/array.data'; -COPY array_index_op_test FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/array.data'; ---- test copying in CSV mode with various styles ---- of embedded line ending characters -create temp table copytest ( - style text, - test text, - filler int); -ERROR: PG-XC does not yet support temporary tables -insert into copytest values('DOS',E'abc\r\ndef',1); -ERROR: relation "copytest" does not exist -LINE 1: insert into copytest values('DOS',E'abc\r\ndef',1); - ^ -insert into copytest values('Unix',E'abc\ndef',2); -ERROR: relation "copytest" does not exist -LINE 1: insert into copytest values('Unix',E'abc\ndef',2); - ^ -insert into copytest values('Mac',E'abc\rdef',3); -ERROR: relation "copytest" does not exist -LINE 1: insert into copytest values('Mac',E'abc\rdef',3); - ^ -insert into copytest values(E'esc\\ape',E'a\\r\\\r\\\n\\nb',4); -ERROR: relation "copytest" does not exist -LINE 1: insert into copytest values(E'esc\\ape',E'a\\r\\\r\\\n\\nb',... - ^ -copy copytest to '/home/abbas/pgxc/postgres-xc/src/test/regress/results/copytest.csv' csv; -ERROR: relation "copytest" does not exist -create temp table copytest2 (like copytest); -ERROR: relation "copytest" does not exist -LINE 1: create temp table copytest2 (like copytest); - ^ -copy copytest2 from '/home/abbas/pgxc/postgres-xc/src/test/regress/results/copytest.csv' csv; -ERROR: relation "copytest2" does not exist -select * from copytest except select * from copytest2; -ERROR: relation "copytest" does not exist -LINE 1: select * from copytest except select * from copytest2; - ^ -truncate copytest2; -ERROR: relation "copytest2" does not exist ---- same test but with an escape char different from quote char -copy copytest to '/home/abbas/pgxc/postgres-xc/src/test/regress/results/copytest.csv' csv quote '''' escape E'\\'; -ERROR: relation "copytest" does not exist -copy copytest2 from '/home/abbas/pgxc/postgres-xc/src/test/regress/results/copytest.csv' csv quote '''' escape E'\\'; -ERROR: relation "copytest2" does not exist -select * from copytest except select * from copytest2; -ERROR: relation "copytest" does not exist -LINE 1: select * from copytest except select * from copytest2; - ^ --- test header line feature -create temp table copytest3 ( - c1 int, - "col with , comma" text, - "col with "" quote" int); -ERROR: PG-XC does not yet support temporary tables -copy copytest3 from stdin csv header; -ERROR: relation "copytest3" does not exist -this is just a line full of junk that would error out if parsed -1,a,1 -2,b,2 -\. -invalid command \. -copy copytest3 to stdout csv header; -ERROR: syntax error at or near "this" -LINE 1: this is just a line full of junk that would error out if par... - ^ ----------------------------------------------------------------------- Summary of changes: src/test/regress/expected/copy_2.out | 99 ---------------------------------- 1 files changed, 0 insertions(+), 99 deletions(-) delete mode 100644 src/test/regress/expected/copy_2.out hooks/post-receive -- Postgres-XC |
From: Abbas B. <ga...@us...> - 2011-04-11 21:13:51
|
Project "Postgres-XC". The branch, master has been updated via dc2762989aaf0946219444d81b12222ac3b553a0 (commit) from 988a22ba73575b836ea2842c17fc375305fdc266 (commit) - Log ----------------------------------------------------------------- commit dc2762989aaf0946219444d81b12222ac3b553a0 Author: Abbas <abb...@en...> Date: Tue Apr 12 02:13:25 2011 +0500 To make sure misc test cases passes diff --git a/src/backend/utils/cache/typcache.c b/src/backend/utils/cache/typcache.c index 2009614..0124eb0 100644 --- a/src/backend/utils/cache/typcache.c +++ b/src/backend/utils/cache/typcache.c @@ -143,7 +143,11 @@ lookup_type_cache(Oid type_id, int flags) tp = SearchSysCache1(TYPEOID, ObjectIdGetDatum(type_id)); if (!HeapTupleIsValid(tp)) +#ifdef PGXC + elog(ERROR, "cache lookup failed for type"); +#else elog(ERROR, "cache lookup failed for type %u", type_id); +#endif typtup = (Form_pg_type) GETSTRUCT(tp); if (!typtup->typisdefined) ereport(ERROR, diff --git a/src/test/regress/expected/misc_1.out b/src/test/regress/expected/misc_1.out index 9f32b64..322fd26 100644 --- a/src/test/regress/expected/misc_1.out +++ b/src/test/regress/expected/misc_1.out @@ -435,13 +435,13 @@ SELECT class, aa, a FROM a_star* ORDER BY 1,2; -- everyone else does nothing. -- SELECT p.name, name(p.hobbies) FROM ONLY person p ORDER BY 1,2; -ERROR: cache lookup failed for type 24546176 +ERROR: cache lookup failed for type CONTEXT: SQL function "hobbies" statement 1 -- -- as above, but jeff also does post_hacking. -- SELECT p.name, name(p.hobbies) FROM person* p ORDER BY 1,2; -ERROR: cache lookup failed for type 24546176 +ERROR: cache lookup failed for type CONTEXT: SQL function "hobbies" statement 1 -- -- the next two queries demonstrate how functions generate bogus duplicates. @@ -449,10 +449,10 @@ CONTEXT: SQL function "hobbies" statement 1 -- SELECT DISTINCT hobbies_r.name, name(hobbies_r.equipment) FROM hobbies_r ORDER BY 1,2; -ERROR: cache lookup failed for type 1801675112 +ERROR: cache lookup failed for type CONTEXT: SQL function "equipment" statement 1 SELECT hobbies_r.name, (hobbies_r.equipment).name FROM hobbies_r ORDER BY 1,2; -ERROR: cache lookup failed for type 1801675112 +ERROR: cache lookup failed for type CONTEXT: SQL function "equipment" statement 1 -- -- mike needs advil and peet's coffee, @@ -460,29 +460,29 @@ CONTEXT: SQL function "equipment" statement 1 -- everyone else is fine. -- SELECT p.name, name(p.hobbies), name(equipment(p.hobbies)) FROM ONLY person p ORDER BY 1,2,3; -ERROR: cache lookup failed for type 24546176 +ERROR: cache lookup failed for type CONTEXT: SQL function "hobbies" statement 1 -- -- as above, but jeff needs advil and peet's coffee as well. -- SELECT p.name, name(p.hobbies), name(equipment(p.hobbies)) FROM person* p ORDER BY 1,2,3; -ERROR: cache lookup failed for type 24546176 +ERROR: cache lookup failed for type CONTEXT: SQL function "hobbies" statement 1 -- -- just like the last two, but make sure that the target list fixup and -- unflattening is being done correctly. -- SELECT name(equipment(p.hobbies)), p.name, name(p.hobbies) FROM ONLY person p ORDER BY 1,2,3; -ERROR: cache lookup failed for type 24546176 +ERROR: cache lookup failed for type CONTEXT: SQL function "hobbies" statement 1 SELECT (p.hobbies).equipment.name, p.name, name(p.hobbies) FROM person* p ORDER BY 1,2,3; -ERROR: cache lookup failed for type 24546176 +ERROR: cache lookup failed for type CONTEXT: SQL function "hobbies" statement 1 SELECT (p.hobbies).equipment.name, name(p.hobbies), p.name FROM ONLY person p ORDER BY 1,2,3; -ERROR: cache lookup failed for type 24546176 +ERROR: cache lookup failed for type CONTEXT: SQL function "hobbies" statement 1 SELECT name(equipment(p.hobbies)), name(p.hobbies), p.name FROM person* p ORDER BY 1,2,3; -ERROR: cache lookup failed for type 24546176 +ERROR: cache lookup failed for type CONTEXT: SQL function "hobbies" statement 1 SELECT user_relns() AS user_relns ORDER BY user_relns; @@ -602,7 +602,7 @@ SELECT hobbies_by_name('basketball'); (1 row) SELECT name, overpaid(emp.*) FROM emp ORDER BY 1,2; -ERROR: cache lookup failed for type 28271 +ERROR: cache lookup failed for type -- -- Try a few cases with SQL-spec row constructor expressions -- @@ -617,10 +617,10 @@ SELECT name(equipment(ROW('skywalking', 'mer'))); (0 rows) SELECT *, name(equipment(h.*)) FROM hobbies_r h ORDER BY 1,2,3; -ERROR: cache lookup failed for type 1801675112 +ERROR: cache lookup failed for type CONTEXT: SQL function "equipment" statement 1 SELECT *, (equipment(CAST((h.*) AS hobbies_r))).name FROM hobbies_r h ORDER BY 1,2,3; -ERROR: cache lookup failed for type 1801675112 +ERROR: cache lookup failed for type CONTEXT: SQL function "equipment" statement 1 -- -- check that old-style C functions work properly with TOASTed values ----------------------------------------------------------------------- Summary of changes: src/backend/utils/cache/typcache.c | 4 ++++ src/test/regress/expected/misc_1.out | 26 +++++++++++++------------- 2 files changed, 17 insertions(+), 13 deletions(-) hooks/post-receive -- Postgres-XC |
From: Abbas B. <ga...@us...> - 2011-04-11 21:01:56
|
Project "Postgres-XC". The branch, master has been updated via 988a22ba73575b836ea2842c17fc375305fdc266 (commit) from 0e849c14308e999ac79c9ba982487149d80fffd8 (commit) - Log ----------------------------------------------------------------- commit 988a22ba73575b836ea2842c17fc375305fdc266 Author: Abbas <abb...@en...> Date: Tue Apr 12 02:01:23 2011 +0500 Alternate expected output file for copy test case diff --git a/src/test/regress/expected/copy_2.out b/src/test/regress/expected/copy_2.out new file mode 100644 index 0000000..80a0ea4 --- /dev/null +++ b/src/test/regress/expected/copy_2.out @@ -0,0 +1,99 @@ +-- +-- COPY +-- +-- CLASS POPULATION +-- (any resemblance to real life is purely coincidental) +-- +COPY aggtest FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/agg.data'; +COPY onek FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/onek.data'; +COPY onek TO '/home/abbas/pgxc/postgres-xc/src/test/regress/results/onek.data'; +DELETE FROM onek; +COPY onek FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/results/onek.data'; +COPY tenk1 FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/tenk.data'; +COPY slow_emp4000 FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/rect.data'; +COPY person FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/person.data'; +COPY emp FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/emp.data'; +COPY student FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/student.data'; +COPY stud_emp FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/stud_emp.data'; +COPY road FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/streets.data'; +COPY real_city FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/real_city.data'; +COPY hash_i4_heap FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/hash.data'; +COPY hash_name_heap FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/hash.data'; +COPY hash_txt_heap FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/hash.data'; +COPY hash_f8_heap FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/hash.data'; +COPY test_tsvector FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/tsearch.data'; +-- the data in this file has a lot of duplicates in the index key +-- fields, leading to long bucket chains and lots of table expansion. +-- this is therefore a stress test of the bucket overflow code (unlike +-- the data in hash.data, which has unique index keys). +-- +-- COPY hash_ovfl_heap FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/hashovfl.data'; +COPY bt_i4_heap FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/desc.data'; +COPY bt_name_heap FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/hash.data'; +COPY bt_txt_heap FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/desc.data'; +COPY bt_f8_heap FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/hash.data'; +COPY array_op_test FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/array.data'; +COPY array_index_op_test FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/array.data'; +--- test copying in CSV mode with various styles +--- of embedded line ending characters +create temp table copytest ( + style text, + test text, + filler int); +ERROR: PG-XC does not yet support temporary tables +insert into copytest values('DOS',E'abc\r\ndef',1); +ERROR: relation "copytest" does not exist +LINE 1: insert into copytest values('DOS',E'abc\r\ndef',1); + ^ +insert into copytest values('Unix',E'abc\ndef',2); +ERROR: relation "copytest" does not exist +LINE 1: insert into copytest values('Unix',E'abc\ndef',2); + ^ +insert into copytest values('Mac',E'abc\rdef',3); +ERROR: relation "copytest" does not exist +LINE 1: insert into copytest values('Mac',E'abc\rdef',3); + ^ +insert into copytest values(E'esc\\ape',E'a\\r\\\r\\\n\\nb',4); +ERROR: relation "copytest" does not exist +LINE 1: insert into copytest values(E'esc\\ape',E'a\\r\\\r\\\n\\nb',... + ^ +copy copytest to '/home/abbas/pgxc/postgres-xc/src/test/regress/results/copytest.csv' csv; +ERROR: relation "copytest" does not exist +create temp table copytest2 (like copytest); +ERROR: relation "copytest" does not exist +LINE 1: create temp table copytest2 (like copytest); + ^ +copy copytest2 from '/home/abbas/pgxc/postgres-xc/src/test/regress/results/copytest.csv' csv; +ERROR: relation "copytest2" does not exist +select * from copytest except select * from copytest2; +ERROR: relation "copytest" does not exist +LINE 1: select * from copytest except select * from copytest2; + ^ +truncate copytest2; +ERROR: relation "copytest2" does not exist +--- same test but with an escape char different from quote char +copy copytest to '/home/abbas/pgxc/postgres-xc/src/test/regress/results/copytest.csv' csv quote '''' escape E'\\'; +ERROR: relation "copytest" does not exist +copy copytest2 from '/home/abbas/pgxc/postgres-xc/src/test/regress/results/copytest.csv' csv quote '''' escape E'\\'; +ERROR: relation "copytest2" does not exist +select * from copytest except select * from copytest2; +ERROR: relation "copytest" does not exist +LINE 1: select * from copytest except select * from copytest2; + ^ +-- test header line feature +create temp table copytest3 ( + c1 int, + "col with , comma" text, + "col with "" quote" int); +ERROR: PG-XC does not yet support temporary tables +copy copytest3 from stdin csv header; +ERROR: relation "copytest3" does not exist +this is just a line full of junk that would error out if parsed +1,a,1 +2,b,2 +\. +invalid command \. +copy copytest3 to stdout csv header; +ERROR: syntax error at or near "this" +LINE 1: this is just a line full of junk that would error out if par... + ^ ----------------------------------------------------------------------- Summary of changes: .../regress/expected/{copy_1.out => copy_2.out} | 0 1 files changed, 0 insertions(+), 0 deletions(-) copy src/test/regress/expected/{copy_1.out => copy_2.out} (100%) hooks/post-receive -- Postgres-XC |
From: Abbas B. <ga...@us...> - 2011-04-11 20:45:45
|
Project "Postgres-XC". The branch, master has been updated via 0e849c14308e999ac79c9ba982487149d80fffd8 (commit) from 45c60e566d02f2f83d7e079d5f28a5526f177c50 (commit) - Log ----------------------------------------------------------------- commit 0e849c14308e999ac79c9ba982487149d80fffd8 Author: Abbas <abb...@en...> Date: Tue Apr 12 01:45:17 2011 +0500 Expected output file changed for copy test case diff --git a/src/test/regress/expected/copy_1.out b/src/test/regress/expected/copy_1.out new file mode 100644 index 0000000..80a0ea4 --- /dev/null +++ b/src/test/regress/expected/copy_1.out @@ -0,0 +1,99 @@ +-- +-- COPY +-- +-- CLASS POPULATION +-- (any resemblance to real life is purely coincidental) +-- +COPY aggtest FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/agg.data'; +COPY onek FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/onek.data'; +COPY onek TO '/home/abbas/pgxc/postgres-xc/src/test/regress/results/onek.data'; +DELETE FROM onek; +COPY onek FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/results/onek.data'; +COPY tenk1 FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/tenk.data'; +COPY slow_emp4000 FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/rect.data'; +COPY person FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/person.data'; +COPY emp FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/emp.data'; +COPY student FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/student.data'; +COPY stud_emp FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/stud_emp.data'; +COPY road FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/streets.data'; +COPY real_city FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/real_city.data'; +COPY hash_i4_heap FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/hash.data'; +COPY hash_name_heap FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/hash.data'; +COPY hash_txt_heap FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/hash.data'; +COPY hash_f8_heap FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/hash.data'; +COPY test_tsvector FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/tsearch.data'; +-- the data in this file has a lot of duplicates in the index key +-- fields, leading to long bucket chains and lots of table expansion. +-- this is therefore a stress test of the bucket overflow code (unlike +-- the data in hash.data, which has unique index keys). +-- +-- COPY hash_ovfl_heap FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/hashovfl.data'; +COPY bt_i4_heap FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/desc.data'; +COPY bt_name_heap FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/hash.data'; +COPY bt_txt_heap FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/desc.data'; +COPY bt_f8_heap FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/hash.data'; +COPY array_op_test FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/array.data'; +COPY array_index_op_test FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/array.data'; +--- test copying in CSV mode with various styles +--- of embedded line ending characters +create temp table copytest ( + style text, + test text, + filler int); +ERROR: PG-XC does not yet support temporary tables +insert into copytest values('DOS',E'abc\r\ndef',1); +ERROR: relation "copytest" does not exist +LINE 1: insert into copytest values('DOS',E'abc\r\ndef',1); + ^ +insert into copytest values('Unix',E'abc\ndef',2); +ERROR: relation "copytest" does not exist +LINE 1: insert into copytest values('Unix',E'abc\ndef',2); + ^ +insert into copytest values('Mac',E'abc\rdef',3); +ERROR: relation "copytest" does not exist +LINE 1: insert into copytest values('Mac',E'abc\rdef',3); + ^ +insert into copytest values(E'esc\\ape',E'a\\r\\\r\\\n\\nb',4); +ERROR: relation "copytest" does not exist +LINE 1: insert into copytest values(E'esc\\ape',E'a\\r\\\r\\\n\\nb',... + ^ +copy copytest to '/home/abbas/pgxc/postgres-xc/src/test/regress/results/copytest.csv' csv; +ERROR: relation "copytest" does not exist +create temp table copytest2 (like copytest); +ERROR: relation "copytest" does not exist +LINE 1: create temp table copytest2 (like copytest); + ^ +copy copytest2 from '/home/abbas/pgxc/postgres-xc/src/test/regress/results/copytest.csv' csv; +ERROR: relation "copytest2" does not exist +select * from copytest except select * from copytest2; +ERROR: relation "copytest" does not exist +LINE 1: select * from copytest except select * from copytest2; + ^ +truncate copytest2; +ERROR: relation "copytest2" does not exist +--- same test but with an escape char different from quote char +copy copytest to '/home/abbas/pgxc/postgres-xc/src/test/regress/results/copytest.csv' csv quote '''' escape E'\\'; +ERROR: relation "copytest" does not exist +copy copytest2 from '/home/abbas/pgxc/postgres-xc/src/test/regress/results/copytest.csv' csv quote '''' escape E'\\'; +ERROR: relation "copytest2" does not exist +select * from copytest except select * from copytest2; +ERROR: relation "copytest" does not exist +LINE 1: select * from copytest except select * from copytest2; + ^ +-- test header line feature +create temp table copytest3 ( + c1 int, + "col with , comma" text, + "col with "" quote" int); +ERROR: PG-XC does not yet support temporary tables +copy copytest3 from stdin csv header; +ERROR: relation "copytest3" does not exist +this is just a line full of junk that would error out if parsed +1,a,1 +2,b,2 +\. +invalid command \. +copy copytest3 to stdout csv header; +ERROR: syntax error at or near "this" +LINE 1: this is just a line full of junk that would error out if par... + ^ ----------------------------------------------------------------------- Summary of changes: .../{output/copy_1.source => expected/copy_1.out} | 57 ++++++++++---------- 1 files changed, 28 insertions(+), 29 deletions(-) copy src/test/regress/{output/copy_1.source => expected/copy_1.out} (52%) hooks/post-receive -- Postgres-XC |
From: Abbas B. <ga...@us...> - 2011-04-11 20:41:51
|
Project "Postgres-XC". The branch, master has been updated via 45c60e566d02f2f83d7e079d5f28a5526f177c50 (commit) from 690b8663292919c383c4e6c35e3df776ee346b45 (commit) - Log ----------------------------------------------------------------- commit 45c60e566d02f2f83d7e079d5f28a5526f177c50 Author: Abbas <abb...@en...> Date: Tue Apr 12 01:41:26 2011 +0500 The expected output file for select test case diff --git a/src/test/regress/expected/select_1.out b/src/test/regress/expected/select_1.out index 8bbcdb9..23af4ca 100644 --- a/src/test/regress/expected/select_1.out +++ b/src/test/regress/expected/select_1.out @@ -213,7 +213,6 @@ SELECT onek.unique1, onek.string4 FROM onek -- followed by sort, because that could hide index ordering problems. -- ANALYZE onek2; -ERROR: relation "onek2" does not exist SET enable_seqscan TO off; SET enable_bitmapscan TO off; SET enable_sort TO off; @@ -221,27 +220,79 @@ SET enable_sort TO off; -- awk '{if($1<10){print $0;}else{next;}}' onek.data | sort +0n -1 -- SELECT onek2.* FROM onek2 WHERE onek2.unique1 < 10 ORDER BY unique1; -ERROR: relation "onek2" does not exist -LINE 1: SELECT onek2.* FROM onek2 WHERE onek2.unique1 < 10 ORDER BY ... - ^ + unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4 +---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+--------- + 0 | 998 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | AAAAAA | KMBAAA | OOOOxx + 1 | 214 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 2 | 3 | BAAAAA | GIAAAA | OOOOxx + 2 | 326 | 0 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 4 | 5 | CAAAAA | OMAAAA | OOOOxx + 3 | 431 | 1 | 3 | 3 | 3 | 3 | 3 | 3 | 3 | 3 | 6 | 7 | DAAAAA | PQAAAA | VVVVxx + 4 | 833 | 0 | 0 | 4 | 4 | 4 | 4 | 4 | 4 | 4 | 8 | 9 | EAAAAA | BGBAAA | HHHHxx + 5 | 541 | 1 | 1 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 10 | 11 | FAAAAA | VUAAAA | HHHHxx + 6 | 978 | 0 | 2 | 6 | 6 | 6 | 6 | 6 | 6 | 6 | 12 | 13 | GAAAAA | QLBAAA | OOOOxx + 7 | 647 | 1 | 3 | 7 | 7 | 7 | 7 | 7 | 7 | 7 | 14 | 15 | HAAAAA | XYAAAA | VVVVxx + 8 | 653 | 0 | 0 | 8 | 8 | 8 | 8 | 8 | 8 | 8 | 16 | 17 | IAAAAA | DZAAAA | HHHHxx + 9 | 49 | 1 | 1 | 9 | 9 | 9 | 9 | 9 | 9 | 9 | 18 | 19 | JAAAAA | XBAAAA | HHHHxx +(10 rows) + -- -- awk '{if($1<20){print $1,$14;}else{next;}}' onek.data | sort +0nr -1 -- SELECT onek2.unique1, onek2.stringu1 FROM onek2 WHERE onek2.unique1 < 20 ORDER BY unique1 using >; -ERROR: relation "onek2" does not exist -LINE 1: SELECT onek2.unique1, onek2.stringu1 FROM onek2 - ^ + unique1 | stringu1 +---------+---------- + 19 | TAAAAA + 18 | SAAAAA + 17 | RAAAAA + 16 | QAAAAA + 15 | PAAAAA + 14 | OAAAAA + 13 | NAAAAA + 12 | MAAAAA + 11 | LAAAAA + 10 | KAAAAA + 9 | JAAAAA + 8 | IAAAAA + 7 | HAAAAA + 6 | GAAAAA + 5 | FAAAAA + 4 | EAAAAA + 3 | DAAAAA + 2 | CAAAAA + 1 | BAAAAA + 0 | AAAAAA +(20 rows) + -- -- awk '{if($1>980){print $1,$14;}else{next;}}' onek.data | sort +1d -2 -- SELECT onek2.unique1, onek2.stringu1 FROM onek2 WHERE onek2.unique1 > 980 ORDER BY unique1 using <; -ERROR: relation "onek2" does not exist -LINE 1: SELECT onek2.unique1, onek2.stringu1 FROM onek2 - ^ + unique1 | stringu1 +---------+---------- + 981 | TLAAAA + 982 | ULAAAA + 983 | VLAAAA + 984 | WLAAAA + 985 | XLAAAA + 986 | YLAAAA + 987 | ZLAAAA + 988 | AMAAAA + 989 | BMAAAA + 990 | CMAAAA + 991 | DMAAAA + 992 | EMAAAA + 993 | FMAAAA + 994 | GMAAAA + 995 | HMAAAA + 996 | IMAAAA + 997 | JMAAAA + 998 | KMAAAA + 999 | LMAAAA +(19 rows) + RESET enable_seqscan; RESET enable_bitmapscan; RESET enable_sort; @@ -267,6 +318,7 @@ SELECT p.name, p.age FROM person* p carina | 58 carmen | 78 chris | 78 + cim | 30 denise | 24 diane | 18 edna | 18 @@ -276,6 +328,7 @@ SELECT p.name, p.age FROM person* p gina | 18 jane | 58 jean | 28 + jeff | 23 jenifer | 38 joan | 18 joe | 20 @@ -285,6 +338,7 @@ SELECT p.name, p.age FROM person* p koko | 88 larry | 60 leah | 68 + linda | 19 lita | 25 liza | 38 louise | 98 @@ -315,7 +369,7 @@ SELECT p.name, p.age FROM person* p wendy | 78 zena | 98 zola | 58 -(55 rows) +(58 rows) -- -- awk '{print $1,$2;}' person.data | @@ -364,6 +418,7 @@ SELECT p.name, p.age FROM person* p ORDER BY age using >, name; teresa | 38 sally | 34 alex | 30 + cim | 30 sam | 30 fred | 28 jean | 28 @@ -372,8 +427,10 @@ SELECT p.name, p.age FROM person* p ORDER BY age using >, name; lita | 25 sharon | 25 denise | 24 + jeff | 23 bill | 20 joe | 20 + linda | 19 sandra | 19 diane | 18 edna | 18 @@ -382,7 +439,7 @@ SELECT p.name, p.age FROM person* p ORDER BY age using >, name; pat | 18 fanny | 8 mary | 8 -(55 rows) +(58 rows) -- -- Test some cases involving whole-row Var referencing a subquery ----------------------------------------------------------------------- Summary of changes: src/test/regress/expected/select_1.out | 81 +++++++++++++++++++++++++++----- 1 files changed, 69 insertions(+), 12 deletions(-) hooks/post-receive -- Postgres-XC |
From: Abbas B. <ga...@us...> - 2011-04-11 20:38:46
|
Project "Postgres-XC". The branch, master has been updated via 690b8663292919c383c4e6c35e3df776ee346b45 (commit) from 1916490d851c62a8ed14807228c2fe5032a90cad (commit) - Log ----------------------------------------------------------------- commit 690b8663292919c383c4e6c35e3df776ee346b45 Author: Abbas <abb...@en...> Date: Tue Apr 12 01:38:15 2011 +0500 The expected output files have changed because of changes in SQL diff --git a/src/test/regress/expected/create_index_1.out b/src/test/regress/expected/create_index_1.out index 0c5b67d..52fdc91 100644 --- a/src/test/regress/expected/create_index_1.out +++ b/src/test/regress/expected/create_index_1.out @@ -41,13 +41,10 @@ CREATE INDEX bt_f8_index ON bt_f8_heap USING btree (seqno float8_ops); -- CREATE INDEX onek2_u1_prtl ON onek2 USING btree(unique1 int4_ops) where unique1 < 20 or unique1 > 980; -ERROR: relation "onek2" does not exist CREATE INDEX onek2_u2_prtl ON onek2 USING btree(unique2 int4_ops) where stringu1 < 'B'; -ERROR: relation "onek2" does not exist CREATE INDEX onek2_stu1_prtl ON onek2 USING btree(stringu1 name_ops) where onek2.stringu1 >= 'J' and onek2.stringu1 < 'K'; -ERROR: relation "onek2" does not exist -- -- GiST (rtree-equivalent opclasses only) -- diff --git a/src/test/regress/expected/create_misc_1.out b/src/test/regress/expected/create_misc_1.out index f728a4f..4fa9e62 100644 --- a/src/test/regress/expected/create_misc_1.out +++ b/src/test/regress/expected/create_misc_1.out @@ -7,6 +7,25 @@ INSERT INTO tenk2 SELECT * FROM tenk1; SELECT * INTO TABLE onek2 FROM onek; ERROR: INTO clause not yet supported +CREATE TABLE onek2 ( + unique1 int4, + unique2 int4, + two int4, + four int4, + ten int4, + twenty int4, + hundred int4, + thousand int4, + twothousand int4, + fivethous int4, + tenthous int4, + odd int4, + even int4, + stringu1 name, + stringu2 name, + string4 name +); +COPY onek2 FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/onek.data'; INSERT INTO fast_emp4000 SELECT * FROM slow_emp4000; SELECT * INTO TABLE Bprime @@ -54,79 +73,31 @@ INSERT INTO c_star (class, c) VALUES ('c', 'hi paul'::name); INSERT INTO c_star (class) VALUES ('c'); INSERT INTO d_star (class, a, b, c, d) VALUES ('d', 7, 'grumble'::text, 'hi sunita'::name, '0.0'::float8); -ERROR: relation "d_star" does not exist -LINE 1: INSERT INTO d_star (class, a, b, c, d) - ^ INSERT INTO d_star (class, a, b, c) VALUES ('d', 8, 'stumble'::text, 'hi koko'::name); -ERROR: relation "d_star" does not exist -LINE 1: INSERT INTO d_star (class, a, b, c) - ^ INSERT INTO d_star (class, a, b, d) VALUES ('d', 9, 'rumble'::text, '1.1'::float8); -ERROR: relation "d_star" does not exist -LINE 1: INSERT INTO d_star (class, a, b, d) - ^ INSERT INTO d_star (class, a, c, d) VALUES ('d', 10, 'hi kristin'::name, '10.01'::float8); -ERROR: relation "d_star" does not exist -LINE 1: INSERT INTO d_star (class, a, c, d) - ^ INSERT INTO d_star (class, b, c, d) VALUES ('d', 'crumble'::text, 'hi boris'::name, '100.001'::float8); -ERROR: relation "d_star" does not exist -LINE 1: INSERT INTO d_star (class, b, c, d) - ^ INSERT INTO d_star (class, a, b) VALUES ('d', 11, 'fumble'::text); -ERROR: relation "d_star" does not exist -LINE 1: INSERT INTO d_star (class, a, b) - ^ INSERT INTO d_star (class, a, c) VALUES ('d', 12, 'hi avi'::name); -ERROR: relation "d_star" does not exist -LINE 1: INSERT INTO d_star (class, a, c) - ^ INSERT INTO d_star (class, a, d) VALUES ('d', 13, '1000.0001'::float8); -ERROR: relation "d_star" does not exist -LINE 1: INSERT INTO d_star (class, a, d) - ^ INSERT INTO d_star (class, b, c) VALUES ('d', 'tumble'::text, 'hi andrew'::name); -ERROR: relation "d_star" does not exist -LINE 1: INSERT INTO d_star (class, b, c) - ^ INSERT INTO d_star (class, b, d) VALUES ('d', 'humble'::text, '10000.00001'::float8); -ERROR: relation "d_star" does not exist -LINE 1: INSERT INTO d_star (class, b, d) - ^ INSERT INTO d_star (class, c, d) VALUES ('d', 'hi ginger'::name, '100000.000001'::float8); -ERROR: relation "d_star" does not exist -LINE 1: INSERT INTO d_star (class, c, d) - ^ INSERT INTO d_star (class, a) VALUES ('d', 14); -ERROR: relation "d_star" does not exist -LINE 1: INSERT INTO d_star (class, a) VALUES ('d', 14); - ^ INSERT INTO d_star (class, b) VALUES ('d', 'jumble'::text); -ERROR: relation "d_star" does not exist -LINE 1: INSERT INTO d_star (class, b) VALUES ('d', 'jumble'::text); - ^ INSERT INTO d_star (class, c) VALUES ('d', 'hi jolly'::name); -ERROR: relation "d_star" does not exist -LINE 1: INSERT INTO d_star (class, c) VALUES ('d', 'hi jolly'::name)... - ^ INSERT INTO d_star (class, d) VALUES ('d', '1000000.0000001'::float8); -ERROR: relation "d_star" does not exist -LINE 1: INSERT INTO d_star (class, d) VALUES ('d', '1000000.0000001'... - ^ INSERT INTO d_star (class) VALUES ('d'); -ERROR: relation "d_star" does not exist -LINE 1: INSERT INTO d_star (class) VALUES ('d'); - ^ INSERT INTO e_star (class, a, c, e) VALUES ('e', 15, 'hi carol'::name, '-1'::int2); INSERT INTO e_star (class, a, c) diff --git a/src/test/regress/expected/create_table_1.out b/src/test/regress/expected/create_table_1.out index 6728a0c..4f650a8 100644 --- a/src/test/regress/expected/create_table_1.out +++ b/src/test/regress/expected/create_table_1.out @@ -85,6 +85,10 @@ NOTICE: merging multiple inherited definitions of column "name" NOTICE: merging multiple inherited definitions of column "age" NOTICE: merging multiple inherited definitions of column "location" ERROR: Cannot currently distribute a table with more than one parent. +CREATE TABLE stud_emp ( + gpa float8, + percent int4 +) INHERITS (emp); CREATE TABLE city ( name name, location box, @@ -139,6 +143,10 @@ CREATE TABLE d_star ( NOTICE: merging multiple inherited definitions of column "class" NOTICE: merging multiple inherited definitions of column "a" ERROR: Cannot currently distribute a table with more than one parent. +CREATE TABLE d_star ( + c name, + d float8 +) INHERITS (b_star); CREATE TABLE e_star ( e int2 ) INHERITS (c_star); diff --git a/src/test/regress/expected/select_into_1.out b/src/test/regress/expected/select_into_1.out index 3ef82f6..3751151 100644 --- a/src/test/regress/expected/select_into_1.out +++ b/src/test/regress/expected/select_into_1.out @@ -12,8 +12,6 @@ SELECT * INTO TABLE tmp1 FROM onek2 WHERE onek2.unique1 < 2; -ERROR: relation "onek2" does not exist -LINE 3: FROM onek2 - ^ +ERROR: INTO clause not yet supported DROP TABLE tmp1; ERROR: table "tmp1" does not exist ----------------------------------------------------------------------- Summary of changes: src/test/regress/expected/create_index_1.out | 3 - src/test/regress/expected/create_misc_1.out | 67 +++++++------------------ src/test/regress/expected/create_table_1.out | 8 +++ src/test/regress/expected/select_into_1.out | 4 +- 4 files changed, 28 insertions(+), 54 deletions(-) hooks/post-receive -- Postgres-XC |
From: Abbas B. <ga...@us...> - 2011-04-11 19:29:36
|
Project "Postgres-XC". The branch, master has been updated via 1916490d851c62a8ed14807228c2fe5032a90cad (commit) from 92db090c02780f57caed42290d4e59895f41cff4 (commit) - Log ----------------------------------------------------------------- commit 1916490d851c62a8ed14807228c2fe5032a90cad Author: Abbas <abb...@en...> Date: Tue Apr 12 00:28:54 2011 +0500 The alternate output file for misc test case diff --git a/src/test/regress/expected/misc_1.out b/src/test/regress/expected/misc_1.out new file mode 100644 index 0000000..9f32b64 --- /dev/null +++ b/src/test/regress/expected/misc_1.out @@ -0,0 +1,651 @@ +-- +-- MISC +-- +-- +-- BTREE +-- +UPDATE onek + SET unique1 = onek.unique1 + 1; +ERROR: Partition column can't be updated in current version +UPDATE onek + SET unique1 = onek.unique1 - 1; +ERROR: Partition column can't be updated in current version +-- +-- BTREE partial +-- +-- UPDATE onek2 +-- SET unique1 = onek2.unique1 + 1; +--UPDATE onek2 +-- SET unique1 = onek2.unique1 - 1; +-- +-- BTREE shutting out non-functional updates +-- +-- the following two tests seem to take a long time on some +-- systems. This non-func update stuff needs to be examined +-- more closely. - jolly (2/22/96) +-- +UPDATE tmp + SET stringu1 = reverse_name(onek.stringu1) + FROM onek + WHERE onek.stringu1 = 'JBAAAA' and + onek.stringu1 = tmp.stringu1; +ERROR: relation "tmp" does not exist +LINE 1: UPDATE tmp + ^ +UPDATE tmp + SET stringu1 = reverse_name(onek2.stringu1) + FROM onek2 + WHERE onek2.stringu1 = 'JCAAAA' and + onek2.stringu1 = tmp.stringu1; +ERROR: relation "tmp" does not exist +LINE 1: UPDATE tmp + ^ +DROP TABLE tmp; +ERROR: table "tmp" does not exist +--UPDATE person* +-- SET age = age + 1; +--UPDATE person* +-- SET age = age + 3 +-- WHERE name = 'linda'; +-- +-- copy +-- +COPY onek TO '/home/abbas/pgxc/postgres-xc/src/test/regress/results/onek.data'; +DELETE FROM onek; +COPY onek FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/results/onek.data'; +SELECT unique1 FROM onek WHERE unique1 < 2 ORDER BY unique1; + unique1 +--------- + 0 + 1 +(2 rows) + +DELETE FROM onek2; +COPY onek2 FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/results/onek.data'; +SELECT unique1 FROM onek2 WHERE unique1 < 2 ORDER BY unique1; + unique1 +--------- + 0 + 1 +(2 rows) + +COPY BINARY stud_emp TO '/home/abbas/pgxc/postgres-xc/src/test/regress/results/stud_emp.data'; +DELETE FROM stud_emp; +COPY BINARY stud_emp FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/results/stud_emp.data'; +ERROR: Error while running COPY +SELECT * FROM stud_emp ORDER BY 1,2; + name | age | location | salary | manager | gpa | percent +------+-----+----------+--------+---------+-----+--------- +(0 rows) + +-- COPY aggtest FROM stdin; +-- 56 7.8 +-- 100 99.097 +-- 0 0.09561 +-- 42 324.78 +-- . +-- COPY aggtest TO stdout; +-- +-- inheritance stress test +-- +SELECT * FROM a_star* ORDER BY 1,2; + class | a +-------+---- + a | 1 + a | 2 + a | + b | 3 + b | 4 + b | + b | + c | 5 + c | 6 + c | + c | + d | 7 + d | 8 + d | 9 + d | 10 + d | 11 + d | 12 + d | 13 + d | 14 + d | + d | + d | + d | + d | + d | + d | + d | + e | 15 + e | 16 + e | 17 + e | 18 + e | + e | + e | + f | 19 + f | 20 + f | 21 + f | 22 + f | 24 + f | 25 + f | 26 + f | 27 + f | + f | + f | + f | + f | + f | + f | + f | +(50 rows) + +SELECT * + FROM b_star* x + WHERE x.b = text 'bumble' or x.a < 3; + class | a | b +-------+---+-------- + b | | bumble +(1 row) + +SELECT class, a + FROM c_star* x + WHERE x.c ~ text 'hi' ORDER BY 1,2; + class | a +-------+---- + c | 5 + c | + e | 15 + e | 16 + e | + e | + f | 19 + f | 20 + f | 21 + f | 24 + f | + f | + f | + f | +(14 rows) + +SELECT class, b, c + FROM d_star* x + WHERE x.a < 100 ORDER BY 1,2,3; + class | b | c +-------+---------+------------ + d | fumble | + d | grumble | hi sunita + d | rumble | + d | stumble | hi koko + d | | hi avi + d | | hi kristin + d | | + d | | +(8 rows) + +SELECT class, c FROM e_star* x WHERE x.c NOTNULL ORDER BY 1,2; + class | c +-------+------------- + e | hi bob + e | hi carol + e | hi elisa + e | hi michelle + f | hi allison + f | hi carl + f | hi claire + f | hi jeff + f | hi keith + f | hi marc + f | hi marcel + f | hi mike +(12 rows) + +SELECT * FROM f_star* x WHERE x.c ISNULL ORDER BY 1,2; + class | a | c | e | f +-------+----+---+-----+------------------------------------------- + f | 22 | | -7 | ((111,555),(222,666),(333,777),(444,888)) + f | 25 | | -9 | + f | 26 | | | ((11111,33333),(22222,44444)) + f | 27 | | | + f | | | -11 | ((1111111,3333333),(2222222,4444444)) + f | | | -12 | + f | | | | ((11111111,33333333),(22222222,44444444)) + f | | | | +(8 rows) + +-- grouping and aggregation on inherited sets have been busted in the past... +SELECT sum(a) FROM a_star*; + sum +----- + 355 +(1 row) + +SELECT class, sum(a) FROM a_star* GROUP BY class ORDER BY class; +ERROR: GROUP BY clause is not yet supported +ALTER TABLE f_star RENAME COLUMN f TO ff; +ALTER TABLE e_star* RENAME COLUMN e TO ee; +ALTER TABLE d_star* RENAME COLUMN d TO dd; +ALTER TABLE c_star* RENAME COLUMN c TO cc; +ALTER TABLE b_star* RENAME COLUMN b TO bb; +ALTER TABLE a_star* RENAME COLUMN a TO aa; +SELECT class, aa + FROM a_star* x + WHERE aa ISNULL ORDER BY 1,2; + class | aa +-------+---- + a | + b | + b | + c | + c | + d | + d | + d | + d | + d | + d | + d | + d | + e | + e | + e | + f | + f | + f | + f | + f | + f | + f | + f | +(24 rows) + +-- As of Postgres 7.1, ALTER implicitly recurses, +-- so this should be same as ALTER a_star* +ALTER TABLE a_star RENAME COLUMN aa TO foo; +SELECT class, foo + FROM a_star* x + WHERE x.foo >= 2 ORDER BY 1,2; + class | foo +-------+----- + a | 2 + b | 3 + b | 4 + c | 5 + c | 6 + d | 7 + d | 8 + d | 9 + d | 10 + d | 11 + d | 12 + d | 13 + d | 14 + e | 15 + e | 16 + e | 17 + e | 18 + f | 19 + f | 20 + f | 21 + f | 22 + f | 24 + f | 25 + f | 26 + f | 27 +(25 rows) + +ALTER TABLE a_star RENAME COLUMN foo TO aa; +SELECT * + from a_star* + WHERE aa < 1000 ORDER BY 1,2; + class | aa +-------+---- + a | 1 + a | 2 + b | 3 + b | 4 + c | 5 + c | 6 + d | 7 + d | 8 + d | 9 + d | 10 + d | 11 + d | 12 + d | 13 + d | 14 + e | 15 + e | 16 + e | 17 + e | 18 + f | 19 + f | 20 + f | 21 + f | 22 + f | 24 + f | 25 + f | 26 + f | 27 +(26 rows) + +ALTER TABLE f_star ADD COLUMN f int4; +UPDATE f_star SET f = 10; +ALTER TABLE e_star* ADD COLUMN e int4; +--UPDATE e_star* SET e = 42; +SELECT * FROM e_star* ORDER BY 1,2,3,4; + class | aa | cc | ee | e +-------+----+-------------+-----+--- + e | 15 | hi carol | -1 | + e | 16 | hi bob | | + e | 17 | | -2 | + e | 18 | | | + e | | hi elisa | | + e | | hi michelle | -3 | + e | | | -4 | + f | 19 | hi claire | -5 | + f | 20 | hi mike | -6 | + f | 21 | hi marcel | | + f | 22 | | -7 | + f | 24 | hi marc | | + f | 25 | | -9 | + f | 26 | | | + f | 27 | | | + f | | hi allison | -10 | + f | | hi carl | | + f | | hi jeff | | + f | | hi keith | -8 | + f | | | -12 | + f | | | -11 | + f | | | | + f | | | | +(23 rows) + +ALTER TABLE a_star* ADD COLUMN a text; +--UPDATE b_star* +-- SET a = text 'gazpacho' +-- WHERE aa > 4; +SELECT class, aa, a FROM a_star* ORDER BY 1,2; + class | aa | a +-------+----+--- + a | 1 | + a | 2 | + a | | + b | 3 | + b | 4 | + b | | + b | | + c | 5 | + c | 6 | + c | | + c | | + d | 7 | + d | 8 | + d | 9 | + d | 10 | + d | 11 | + d | 12 | + d | 13 | + d | 14 | + d | | + d | | + d | | + d | | + d | | + d | | + d | | + d | | + e | 15 | + e | 16 | + e | 17 | + e | 18 | + e | | + e | | + e | | + f | 19 | + f | 20 | + f | 21 | + f | 22 | + f | 24 | + f | 25 | + f | 26 | + f | 27 | + f | | + f | | + f | | + f | | + f | | + f | | + f | | + f | | +(50 rows) + +-- +-- versions +-- +-- +-- postquel functions +-- +-- +-- mike does post_hacking, +-- joe and sally play basketball, and +-- everyone else does nothing. +-- +SELECT p.name, name(p.hobbies) FROM ONLY person p ORDER BY 1,2; +ERROR: cache lookup failed for type 24546176 +CONTEXT: SQL function "hobbies" statement 1 +-- +-- as above, but jeff also does post_hacking. +-- +SELECT p.name, name(p.hobbies) FROM person* p ORDER BY 1,2; +ERROR: cache lookup failed for type 24546176 +CONTEXT: SQL function "hobbies" statement 1 +-- +-- the next two queries demonstrate how functions generate bogus duplicates. +-- this is a "feature" .. +-- +SELECT DISTINCT hobbies_r.name, name(hobbies_r.equipment) FROM hobbies_r + ORDER BY 1,2; +ERROR: cache lookup failed for type 1801675112 +CONTEXT: SQL function "equipment" statement 1 +SELECT hobbies_r.name, (hobbies_r.equipment).name FROM hobbies_r ORDER BY 1,2; +ERROR: cache lookup failed for type 1801675112 +CONTEXT: SQL function "equipment" statement 1 +-- +-- mike needs advil and peet's coffee, +-- joe and sally need hightops, and +-- everyone else is fine. +-- +SELECT p.name, name(p.hobbies), name(equipment(p.hobbies)) FROM ONLY person p ORDER BY 1,2,3; +ERROR: cache lookup failed for type 24546176 +CONTEXT: SQL function "hobbies" statement 1 +-- +-- as above, but jeff needs advil and peet's coffee as well. +-- +SELECT p.name, name(p.hobbies), name(equipment(p.hobbies)) FROM person* p ORDER BY 1,2,3; +ERROR: cache lookup failed for type 24546176 +CONTEXT: SQL function "hobbies" statement 1 +-- +-- just like the last two, but make sure that the target list fixup and +-- unflattening is being done correctly. +-- +SELECT name(equipment(p.hobbies)), p.name, name(p.hobbies) FROM ONLY person p ORDER BY 1,2,3; +ERROR: cache lookup failed for type 24546176 +CONTEXT: SQL function "hobbies" statement 1 +SELECT (p.hobbies).equipment.name, p.name, name(p.hobbies) FROM person* p ORDER BY 1,2,3; +ERROR: cache lookup failed for type 24546176 +CONTEXT: SQL function "hobbies" statement 1 +SELECT (p.hobbies).equipment.name, name(p.hobbies), p.name FROM ONLY person p ORDER BY 1,2,3; +ERROR: cache lookup failed for type 24546176 +CONTEXT: SQL function "hobbies" statement 1 +SELECT name(equipment(p.hobbies)), name(p.hobbies), p.name FROM person* p ORDER BY 1,2,3; +ERROR: cache lookup failed for type 24546176 +CONTEXT: SQL function "hobbies" statement 1 +SELECT user_relns() AS user_relns + ORDER BY user_relns; + user_relns +--------------------- + a + a_star + abstime_tbl + aggtest + aggtype + array_index_op_test + array_op_test + arrtest + b + b_star + box_tbl + bt_f8_heap + bt_i4_heap + bt_name_heap + bt_txt_heap + c + c_star + char_tbl + check2_tbl + check_seq + check_tbl + circle_tbl + city + copy_tbl + d_star + date_tbl + default_seq + default_tbl + dept + e_star + emp + equipment_r + f_star + fast_emp4000 + firstparent + float4_tbl + float8_tbl + foobar + func_index_heap + hash_f8_heap + hash_i4_heap + hash_name_heap + hash_txt_heap + hobbies_r + ihighway + inet_tbl + inhe + inhf + inhx + insert_seq + int2_tbl + int4_tbl + int8_tbl + interval_tbl + iportaltest + log_table + lseg_tbl + main_table + money_data + num_data + num_exp_add + num_exp_div + num_exp_ln + num_exp_log10 + num_exp_mul + num_exp_power_10_ln + num_exp_sqrt + num_exp_sub + num_input_test + num_result + onek + onek2 + path_tbl + person + point_tbl + polygon_tbl + pxtest1 + real_city + reltime_tbl + road + secondparent + shighway + slow_emp4000 + street + stud_emp + student + subselect_tbl + tenk1 + tenk2 + test_tsvector + text_tbl + thirdparent + time_tbl + timestamp_tbl + timestamptz_tbl + timetz_tbl + tinterval_tbl + toyemp + varchar_tbl + writetest +(100 rows) + +SELECT name(equipment(hobby_construct(text 'skywalking', text 'mer'))); + name +------ +(0 rows) + +SELECT hobbies_by_name('basketball'); + hobbies_by_name +----------------- + +(1 row) + +SELECT name, overpaid(emp.*) FROM emp ORDER BY 1,2; +ERROR: cache lookup failed for type 28271 +-- +-- Try a few cases with SQL-spec row constructor expressions +-- +SELECT * FROM equipment(ROW('skywalking', 'mer')); + name | hobby +------+------- +(0 rows) + +SELECT name(equipment(ROW('skywalking', 'mer'))); + name +------ +(0 rows) + +SELECT *, name(equipment(h.*)) FROM hobbies_r h ORDER BY 1,2,3; +ERROR: cache lookup failed for type 1801675112 +CONTEXT: SQL function "equipment" statement 1 +SELECT *, (equipment(CAST((h.*) AS hobbies_r))).name FROM hobbies_r h ORDER BY 1,2,3; +ERROR: cache lookup failed for type 1801675112 +CONTEXT: SQL function "equipment" statement 1 +-- +-- check that old-style C functions work properly with TOASTed values +-- +create table oldstyle_test(i int4, t text); +insert into oldstyle_test values(null,null); +insert into oldstyle_test values(0,'12'); +insert into oldstyle_test values(1000,'12'); +insert into oldstyle_test values(0, repeat('x', 50000)); +select i, length(t), octet_length(t), oldstyle_length(i,t) from oldstyle_test ORDER BY 1,2,3; + i | length | octet_length | oldstyle_length +------+--------+--------------+----------------- + 0 | 2 | 2 | 2 + 0 | 50000 | 50000 | 50000 + 1000 | 2 | 2 | 1002 + | | | +(4 rows) + +drop table oldstyle_test; +-- +-- functional joins +-- +-- +-- instance rules +-- +-- +-- rewrite rules +-- ----------------------------------------------------------------------- Summary of changes: .../{output/misc.source => expected/misc_1.out} | 241 ++++++-------------- 1 files changed, 65 insertions(+), 176 deletions(-) copy src/test/regress/{output/misc.source => expected/misc_1.out} (73%) hooks/post-receive -- Postgres-XC |
From: Abbas B. <ga...@us...> - 2011-04-11 19:26:56
|
Project "Postgres-XC". The branch, master has been updated via 92db090c02780f57caed42290d4e59895f41cff4 (commit) from 4d46aea62369eb13f8e7d874e1ab987021b827b1 (commit) - Log ----------------------------------------------------------------- commit 92db090c02780f57caed42290d4e59895f41cff4 Author: Abbas <abb...@en...> Date: Tue Apr 12 00:22:43 2011 +0500 misc test case now passes after checking in the alternate expected output and making sure that the test pre-reqs are there. Following are the causes of checking in an alternate output file 1. Partition column cannot be updated in the current XC version 2. Temp tables cannot be created. 3. BINARY COPY is not supported. 4. A table inheriting from more than one tables is not supported. Due to this limitation some tables were not being created. The defination of these tables was changed to inherit from one table instead. As a consequence, rows inserted in inherited table go only in one of the base tables and not to the other. The table c_star hence does not contain any rows of class 'd' 5. GROUP BY clause is not supported. 6. PGXC does not show any NOTICE messages in output. 7. SQL Funtions are not supported. 8. Due to limitations of XC some objects are not created e.g. tables containing sequences, for this reason pg_class does not contaion some of the items expected. diff --git a/src/test/regress/input/misc.source b/src/test/regress/input/misc.source index 156fbb4..e0967de 100644 --- a/src/test/regress/input/misc.source +++ b/src/test/regress/input/misc.source @@ -149,7 +149,7 @@ ALTER TABLE e_star* ADD COLUMN e int4; --UPDATE e_star* SET e = 42; -SELECT * FROM e_star* ORDER BY 1,2; +SELECT * FROM e_star* ORDER BY 1,2,3,4; ALTER TABLE a_star* ADD COLUMN a text; diff --git a/src/test/regress/sql/create_misc.sql b/src/test/regress/sql/create_misc.sql index 40c9b41..3bfb242 100644 --- a/src/test/regress/sql/create_misc.sql +++ b/src/test/regress/sql/create_misc.sql @@ -10,6 +10,27 @@ INSERT INTO tenk2 SELECT * FROM tenk1; SELECT * INTO TABLE onek2 FROM onek; +CREATE TABLE onek2 ( + unique1 int4, + unique2 int4, + two int4, + four int4, + ten int4, + twenty int4, + hundred int4, + thousand int4, + twothousand int4, + fivethous int4, + tenthous int4, + odd int4, + even int4, + stringu1 name, + stringu2 name, + string4 name +); + +COPY onek2 FROM '/home/abbas/pgxc/postgres-xc/src/test/regress/data/onek.data'; + INSERT INTO fast_emp4000 SELECT * FROM slow_emp4000; SELECT * diff --git a/src/test/regress/sql/create_table.sql b/src/test/regress/sql/create_table.sql index e43371e..7870484 100644 --- a/src/test/regress/sql/create_table.sql +++ b/src/test/regress/sql/create_table.sql @@ -95,6 +95,10 @@ CREATE TABLE stud_emp ( percent int4 ) INHERITS (emp, student); +CREATE TABLE stud_emp ( + gpa float8, + percent int4 +) INHERITS (emp); CREATE TABLE city ( name name, @@ -159,6 +163,11 @@ CREATE TABLE d_star ( d float8 ) INHERITS (b_star, c_star); +CREATE TABLE d_star ( + c name, + d float8 +) INHERITS (b_star); + CREATE TABLE e_star ( e int2 ) INHERITS (c_star); ----------------------------------------------------------------------- Summary of changes: src/test/regress/input/misc.source | 2 +- src/test/regress/sql/create_misc.sql | 21 +++++++++++++++++++++ src/test/regress/sql/create_table.sql | 9 +++++++++ 3 files changed, 31 insertions(+), 1 deletions(-) hooks/post-receive -- Postgres-XC |
From: Abbas B. <ga...@us...> - 2011-04-11 12:09:24
|
Project "Postgres-XC". The branch, master has been updated via 4d46aea62369eb13f8e7d874e1ab987021b827b1 (commit) from 17cebe041ac8f58d9accd0db678c5e1d5ebfcb14 (commit) - Log ----------------------------------------------------------------- commit 4d46aea62369eb13f8e7d874e1ab987021b827b1 Author: Abbas <abb...@en...> Date: Mon Apr 11 16:40:01 2011 +0500 This patch solves bug ID 3237805 Problem Description: The function deparse_context_for_remotequery was being used to create a deparese_context. While creating the rte for deparse_context, system was passing relation name get_rel_name(rte->relid) to the function. The function would then use makeAlias and was using it in eref of the rte. This would pass table name in eref although user had specified an alias. This meant that the query SELECT p.hobbies FROM person p; would generate this query for data nodes SELECT person.* FROM public.person p; which is an error ERROR: invalid reference to FROM-clause entry for table "person" The solution was to pass rte->eref to the function. diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c index 6114dd2..b6252a3 100644 --- a/src/backend/optimizer/plan/createplan.c +++ b/src/backend/optimizer/plan/createplan.c @@ -2272,8 +2272,7 @@ create_remotequery_plan(PlannerInfo *root, Path *best_path, Assert(best_path->parent->rtekind == RTE_RELATION); Assert(rte->rtekind == RTE_RELATION); - deparse_context = deparse_context_for_remotequery( - get_rel_name(rte->relid), rte->relid); + deparse_context = deparse_context_for_remotequery(rte->eref, rte->relid); /* Sort clauses into best execution order */ scan_clauses = order_qual_clauses(root, scan_clauses); @@ -2316,7 +2315,7 @@ create_remotequery_plan(PlannerInfo *root, Path *best_path, */ foreach(l, (List *)remote_scan_clauses) - { + { Node *clause = lfirst(l); appendStringInfo(&buf, "%s", sep ); diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index 1da8609..6e8be84 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -2103,7 +2103,7 @@ deparse_context_for(const char *aliasname, Oid relid) #ifdef PGXC List * -deparse_context_for_remotequery(const char *aliasname, Oid relid) +deparse_context_for_remotequery(Alias *aliasname, Oid relid) { deparse_namespace *dpns; RangeTblEntry *rte; @@ -2114,7 +2114,7 @@ deparse_context_for_remotequery(const char *aliasname, Oid relid) rte = makeNode(RangeTblEntry); rte->rtekind = RTE_RELATION; rte->relid = relid; - rte->eref = makeAlias(aliasname, NIL); + rte->eref = aliasname; rte->inh = false; rte->inFromCl = true; diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h index 460816d..3cd0975 100644 --- a/src/include/utils/builtins.h +++ b/src/include/utils/builtins.h @@ -617,7 +617,7 @@ extern Datum pg_get_function_result(PG_FUNCTION_ARGS); extern char *deparse_expression(Node *expr, List *dpcontext, bool forceprefix, bool showimplicit); #ifdef PGXC -extern List *deparse_context_for_remotequery(const char *aliasname, Oid relid); +extern List *deparse_context_for_remotequery(Alias *aliasname, Oid relid); extern void get_query_def_from_valuesList(Query *query, StringInfo buf); extern void deparse_query(Query *query, StringInfo buf, List *parentnamespace); #endif ----------------------------------------------------------------------- Summary of changes: src/backend/optimizer/plan/createplan.c | 5 ++--- src/backend/utils/adt/ruleutils.c | 4 ++-- src/include/utils/builtins.h | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) hooks/post-receive -- Postgres-XC |
From: Abbas B. <ga...@us...> - 2011-04-11 09:22:54
|
Project "Postgres-XC". The branch, master has been updated via 17cebe041ac8f58d9accd0db678c5e1d5ebfcb14 (commit) from 2fc3bd26ba3e47ec9ccebbd6cac45cb418be7fd4 (commit) - Log ----------------------------------------------------------------- commit 17cebe041ac8f58d9accd0db678c5e1d5ebfcb14 Author: Abbas <abb...@en...> Date: Mon Apr 11 14:17:25 2011 +0500 Block GROUP BY Clause as long as it is not supported diff --git a/src/backend/optimizer/plan/planmain.c b/src/backend/optimizer/plan/planmain.c index 9e884cb..0d5b831 100644 --- a/src/backend/optimizer/plan/planmain.c +++ b/src/backend/optimizer/plan/planmain.c @@ -298,6 +298,12 @@ query_planner(PlannerInfo *root, List *tlist, { List *groupExprs; +#ifdef PGXC + ereport(ERROR, + (errcode(ERRCODE_STATEMENT_TOO_COMPLEX), + (errmsg("GROUP BY clause is not yet supported")))); +#endif + groupExprs = get_sortgrouplist_exprs(parse->groupClause, parse->targetList); *num_groups = estimate_num_groups(root, ----------------------------------------------------------------------- Summary of changes: src/backend/optimizer/plan/planmain.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) hooks/post-receive -- Postgres-XC |
From: Abbas B. <ga...@us...> - 2011-04-11 07:17:19
|
Project "Postgres-XC". The branch, master has been updated via 2fc3bd26ba3e47ec9ccebbd6cac45cb418be7fd4 (commit) from 000557b15b4468cdf6ee1f9e5d8da977c42942ce (commit) - Log ----------------------------------------------------------------- commit 2fc3bd26ba3e47ec9ccebbd6cac45cb418be7fd4 Author: Abbas <abb...@en...> Date: Mon Apr 11 12:14:54 2011 +0500 This output is OK as long as we do not implement INSERT SELECT feature ID 3284033 diff --git a/src/test/regress/expected/bit_1.out b/src/test/regress/expected/bit_1.out new file mode 100644 index 0000000..d647633 --- /dev/null +++ b/src/test/regress/expected/bit_1.out @@ -0,0 +1,527 @@ +-- +-- BIT types +-- +-- +-- Build tables for testing +-- +CREATE TABLE BIT_TABLE(b BIT(11)); +INSERT INTO BIT_TABLE VALUES (B'10'); -- too short +ERROR: bit string length 2 does not match type bit(11) +INSERT INTO BIT_TABLE VALUES (B'00000000000'); +INSERT INTO BIT_TABLE VALUES (B'11011000000'); +INSERT INTO BIT_TABLE VALUES (B'01010101010'); +INSERT INTO BIT_TABLE VALUES (B'101011111010'); -- too long +ERROR: bit string length 12 does not match type bit(11) +--INSERT INTO BIT_TABLE VALUES ('X554'); +--INSERT INTO BIT_TABLE VALUES ('X555'); +SELECT * FROM BIT_TABLE ORDER BY b; + b +------------- + 00000000000 + 01010101010 + 11011000000 +(3 rows) + +CREATE TABLE VARBIT_TABLE(v BIT VARYING(11)); +INSERT INTO VARBIT_TABLE VALUES (B''); +INSERT INTO VARBIT_TABLE VALUES (B'0'); +INSERT INTO VARBIT_TABLE VALUES (B'010101'); +INSERT INTO VARBIT_TABLE VALUES (B'01010101010'); +INSERT INTO VARBIT_TABLE VALUES (B'101011111010'); -- too long +ERROR: bit string too long for type bit varying(11) +--INSERT INTO VARBIT_TABLE VALUES ('X554'); +--INSERT INTO VARBIT_TABLE VALUES ('X555'); +SELECT * FROM VARBIT_TABLE ORDER BY v; + v +------------- + + 0 + 010101 + 01010101010 +(4 rows) + +-- Concatenation +SELECT v, b, (v || b) AS concat + FROM BIT_TABLE, VARBIT_TABLE + ORDER BY 3; + v | b | concat +-------------+-------------+------------------------ + | 00000000000 | 00000000000 + 0 | 00000000000 | 000000000000 + 0 | 01010101010 | 001010101010 + 010101 | 00000000000 | 01010100000000000 + | 01010101010 | 01010101010 + 01010101010 | 00000000000 | 0101010101000000000000 + 01010101010 | 01010101010 | 0101010101001010101010 + 010101 | 01010101010 | 01010101010101010 + 01010101010 | 11011000000 | 0101010101011011000000 + 010101 | 11011000000 | 01010111011000000 + 0 | 11011000000 | 011011000000 + | 11011000000 | 11011000000 +(12 rows) + +-- Length +SELECT b, length(b) AS lb + FROM BIT_TABLE ORDER BY b; + b | lb +-------------+---- + 00000000000 | 11 + 01010101010 | 11 + 11011000000 | 11 +(3 rows) + +SELECT v, length(v) AS lv + FROM VARBIT_TABLE ORDER BY v; + v | lv +-------------+---- + | 0 + 0 | 1 + 010101 | 6 + 01010101010 | 11 +(4 rows) + +-- Substring +SELECT b, + SUBSTRING(b FROM 2 FOR 4) AS sub_2_4, + SUBSTRING(b FROM 7 FOR 13) AS sub_7_13, + SUBSTRING(b FROM 6) AS sub_6 + FROM BIT_TABLE ORDER BY b; + b | sub_2_4 | sub_7_13 | sub_6 +-------------+---------+----------+-------- + 00000000000 | 0000 | 00000 | 000000 + 01010101010 | 1010 | 01010 | 101010 + 11011000000 | 1011 | 00000 | 000000 +(3 rows) + +SELECT v, + SUBSTRING(v FROM 2 FOR 4) AS sub_2_4, + SUBSTRING(v FROM 7 FOR 13) AS sub_7_13, + SUBSTRING(v FROM 6) AS sub_6 + FROM VARBIT_TABLE ORDER BY v; + v | sub_2_4 | sub_7_13 | sub_6 +-------------+---------+----------+-------- + | | | + 0 | | | + 010101 | 1010 | | 1 + 01010101010 | 1010 | 01010 | 101010 +(4 rows) + +--- Bit operations +DROP TABLE varbit_table; +CREATE TABLE varbit_table (a BIT VARYING(16), b BIT VARYING(16)); +COPY varbit_table FROM stdin; +SELECT a, b, ~a AS "~ a", a & b AS "a & b", + a | b AS "a | b", a # b AS "a # b" FROM varbit_table ORDER BY a,b; + a | b | ~ a | a & b | a | b | a # b +------------------+------------------+------------------+------------------+------------------+------------------ + 0000000000001111 | 0000000000010000 | 1111111111110000 | 0000000000000000 | 0000000000011111 | 0000000000011111 + 0000000100100011 | 1111111111111111 | 1111111011011100 | 0000000100100011 | 1111111111111111 | 1111111011011100 + 00001111 | 00010000 | 11110000 | 00000000 | 00011111 | 00011111 + 0001001000110100 | 1111111111110101 | 1110110111001011 | 0001001000110100 | 1111111111110101 | 1110110111000001 + 00011111 | 00010001 | 11100000 | 00010001 | 00011111 | 00001110 + 0010010001101000 | 0010010001101000 | 1101101110010111 | 0010010001101000 | 0010010001101000 | 0000000000000000 + 00101111 | 00010010 | 11010000 | 00000010 | 00111111 | 00111101 + 00111111 | 00010011 | 11000000 | 00010011 | 00111111 | 00101100 + 10001111 | 00000100 | 01110000 | 00000100 | 10001111 | 10001011 + 1111101001010000 | 0000010110101111 | 0000010110101111 | 0000000000000000 | 1111111111111111 | 1111111111111111 +(10 rows) + +SELECT a,b,a<b AS "a<b",a<=b AS "a<=b",a=b AS "a=b", + a>=b AS "a>=b",a>b AS "a>b",a<>b AS "a<>b" FROM varbit_table ORDER BY a,b; + a | b | a<b | a<=b | a=b | a>=b | a>b | a<>b +------------------+------------------+-----+------+-----+------+-----+------ + 0000000000001111 | 0000000000010000 | t | t | f | f | f | t + 0000000100100011 | 1111111111111111 | t | t | f | f | f | t + 00001111 | 00010000 | t | t | f | f | f | t + 0001001000110100 | 1111111111110101 | t | t | f | f | f | t + 00011111 | 00010001 | f | f | f | t | t | t + 0010010001101000 | 0010010001101000 | f | t | t | t | f | f + 00101111 | 00010010 | f | f | f | t | t | t + 00111111 | 00010011 | f | f | f | t | t | t + 10001111 | 00000100 | f | f | f | t | t | t + 1111101001010000 | 0000010110101111 | f | f | f | t | t | t +(10 rows) + +SELECT a,a<<4 AS "a<<4",b,b>>2 AS "b>>2" FROM varbit_table ORDER BY a,b; + a | a<<4 | b | b>>2 +------------------+------------------+------------------+------------------ + 0000000000001111 | 0000000011110000 | 0000000000010000 | 0000000000000100 + 0000000100100011 | 0001001000110000 | 1111111111111111 | 0011111111111111 + 00001111 | 11110000 | 00010000 | 00000100 + 0001001000110100 | 0010001101000000 | 1111111111110101 | 0011111111111101 + 00011111 | 11110000 | 00010001 | 00000100 + 0010010001101000 | 0100011010000000 | 0010010001101000 | 0000100100011010 + 00101111 | 11110000 | 00010010 | 00000100 + 00111111 | 11110000 | 00010011 | 00000100 + 10001111 | 11110000 | 00000100 | 00000001 + 1111101001010000 | 1010010100000000 | 0000010110101111 | 0000000101101011 +(10 rows) + +DROP TABLE varbit_table; +--- Bit operations +DROP TABLE bit_table; +CREATE TABLE bit_table (a BIT(16), b BIT(16)); +COPY bit_table FROM stdin; +SELECT a,b,~a AS "~ a",a & b AS "a & b", + a|b AS "a | b", a # b AS "a # b" FROM bit_table ORDER BY a,b; + a | b | ~ a | a & b | a | b | a # b +------------------+------------------+------------------+------------------+------------------+------------------ + 0000000000001111 | 0000000000010000 | 1111111111110000 | 0000000000000000 | 0000000000011111 | 0000000000011111 + 0000000100100011 | 1111111111111111 | 1111111011011100 | 0000000100100011 | 1111111111111111 | 1111111011011100 + 0000111100000000 | 0001000000000000 | 1111000011111111 | 0000000000000000 | 0001111100000000 | 0001111100000000 + 0001001000110100 | 1111111111110101 | 1110110111001011 | 0001001000110100 | 1111111111110101 | 1110110111000001 + 0001111100000000 | 0001000100000000 | 1110000011111111 | 0001000100000000 | 0001111100000000 | 0000111000000000 + 0010010001101000 | 0010010001101000 | 1101101110010111 | 0010010001101000 | 0010010001101000 | 0000000000000000 + 0010111100000000 | 0001001000000000 | 1101000011111111 | 0000001000000000 | 0011111100000000 | 0011110100000000 + 0011111100000000 | 0001001100000000 | 1100000011111111 | 0001001100000000 | 0011111100000000 | 0010110000000000 + 1000111100000000 | 0000010000000000 | 0111000011111111 | 0000010000000000 | 1000111100000000 | 1000101100000000 + 1111101001010000 | 0000010110101111 | 0000010110101111 | 0000000000000000 | 1111111111111111 | 1111111111111111 +(10 rows) + +SELECT a,b,a<b AS "a<b",a<=b AS "a<=b",a=b AS "a=b", + a>=b AS "a>=b",a>b AS "a>b",a<>b AS "a<>b" FROM bit_table ORDER BY a,b; + a | b | a<b | a<=b | a=b | a>=b | a>b | a<>b +------------------+------------------+-----+------+-----+------+-----+------ + 0000000000001111 | 0000000000010000 | t | t | f | f | f | t + 0000000100100011 | 1111111111111111 | t | t | f | f | f | t + 0000111100000000 | 0001000000000000 | t | t | f | f | f | t + 0001001000110100 | 1111111111110101 | t | t | f | f | f | t + 0001111100000000 | 0001000100000000 | f | f | f | t | t | t + 0010010001101000 | 0010010001101000 | f | t | t | t | f | f + 0010111100000000 | 0001001000000000 | f | f | f | t | t | t + 0011111100000000 | 0001001100000000 | f | f | f | t | t | t + 1000111100000000 | 0000010000000000 | f | f | f | t | t | t + 1111101001010000 | 0000010110101111 | f | f | f | t | t | t +(10 rows) + +SELECT a,a<<4 AS "a<<4",b,b>>2 AS "b>>2" FROM bit_table ORDER BY a,b; + a | a<<4 | b | b>>2 +------------------+------------------+------------------+------------------ + 0000000000001111 | 0000000011110000 | 0000000000010000 | 0000000000000100 + 0000000100100011 | 0001001000110000 | 1111111111111111 | 0011111111111111 + 0000111100000000 | 1111000000000000 | 0001000000000000 | 0000010000000000 + 0001001000110100 | 0010001101000000 | 1111111111110101 | 0011111111111101 + 0001111100000000 | 1111000000000000 | 0001000100000000 | 0000010001000000 + 0010010001101000 | 0100011010000000 | 0010010001101000 | 0000100100011010 + 0010111100000000 | 1111000000000000 | 0001001000000000 | 0000010010000000 + 0011111100000000 | 1111000000000000 | 0001001100000000 | 0000010011000000 + 1000111100000000 | 1111000000000000 | 0000010000000000 | 0000000100000000 + 1111101001010000 | 1010010100000000 | 0000010110101111 | 0000000101101011 +(10 rows) + +DROP TABLE bit_table; +-- The following should fail +select B'001' & B'10'; +ERROR: cannot AND bit strings of different sizes +select B'0111' | B'011'; +ERROR: cannot OR bit strings of different sizes +select B'0010' # B'011101'; +ERROR: cannot XOR bit strings of different sizes +-- More position tests, checking all the boundary cases +SELECT POSITION(B'1010' IN B'0000101'); -- 0 + position +---------- + 0 +(1 row) + +SELECT POSITION(B'1010' IN B'00001010'); -- 5 + position +---------- + 5 +(1 row) + +SELECT POSITION(B'1010' IN B'00000101'); -- 0 + position +---------- + 0 +(1 row) + +SELECT POSITION(B'1010' IN B'000001010'); -- 6 + position +---------- + 6 +(1 row) + +SELECT POSITION(B'' IN B'00001010'); -- 1 + position +---------- + 1 +(1 row) + +SELECT POSITION(B'0' IN B''); -- 0 + position +---------- + 0 +(1 row) + +SELECT POSITION(B'' IN B''); -- 0 + position +---------- + 0 +(1 row) + +SELECT POSITION(B'101101' IN B'001011011011011000'); -- 3 + position +---------- + 3 +(1 row) + +SELECT POSITION(B'10110110' IN B'001011011011010'); -- 3 + position +---------- + 3 +(1 row) + +SELECT POSITION(B'1011011011011' IN B'001011011011011'); -- 3 + position +---------- + 3 +(1 row) + +SELECT POSITION(B'1011011011011' IN B'00001011011011011'); -- 5 + position +---------- + 5 +(1 row) + +SELECT POSITION(B'11101011' IN B'11101011'); -- 1 + position +---------- + 1 +(1 row) + +SELECT POSITION(B'11101011' IN B'011101011'); -- 2 + position +---------- + 2 +(1 row) + +SELECT POSITION(B'11101011' IN B'00011101011'); -- 4 + position +---------- + 4 +(1 row) + +SELECT POSITION(B'11101011' IN B'0000011101011'); -- 6 + position +---------- + 6 +(1 row) + +SELECT POSITION(B'111010110' IN B'111010110'); -- 1 + position +---------- + 1 +(1 row) + +SELECT POSITION(B'111010110' IN B'0111010110'); -- 2 + position +---------- + 2 +(1 row) + +SELECT POSITION(B'111010110' IN B'000111010110'); -- 4 + position +---------- + 4 +(1 row) + +SELECT POSITION(B'111010110' IN B'00000111010110'); -- 6 + position +---------- + 6 +(1 row) + +SELECT POSITION(B'111010110' IN B'11101011'); -- 0 + position +---------- + 0 +(1 row) + +SELECT POSITION(B'111010110' IN B'011101011'); -- 0 + position +---------- + 0 +(1 row) + +SELECT POSITION(B'111010110' IN B'00011101011'); -- 0 + position +---------- + 0 +(1 row) + +SELECT POSITION(B'111010110' IN B'0000011101011'); -- 0 + position +---------- + 0 +(1 row) + +SELECT POSITION(B'111010110' IN B'111010110'); -- 1 + position +---------- + 1 +(1 row) + +SELECT POSITION(B'111010110' IN B'0111010110'); -- 2 + position +---------- + 2 +(1 row) + +SELECT POSITION(B'111010110' IN B'000111010110'); -- 4 + position +---------- + 4 +(1 row) + +SELECT POSITION(B'111010110' IN B'00000111010110'); -- 6 + position +---------- + 6 +(1 row) + +SELECT POSITION(B'111010110' IN B'000001110101111101011'); -- 0 + position +---------- + 0 +(1 row) + +SELECT POSITION(B'111010110' IN B'0000001110101111101011'); -- 0 + position +---------- + 0 +(1 row) + +SELECT POSITION(B'111010110' IN B'000000001110101111101011'); -- 0 + position +---------- + 0 +(1 row) + +SELECT POSITION(B'111010110' IN B'00000000001110101111101011'); -- 0 + position +---------- + 0 +(1 row) + +SELECT POSITION(B'111010110' IN B'0000011101011111010110'); -- 14 + position +---------- + 14 +(1 row) + +SELECT POSITION(B'111010110' IN B'00000011101011111010110'); -- 15 + position +---------- + 15 +(1 row) + +SELECT POSITION(B'111010110' IN B'0000000011101011111010110'); -- 17 + position +---------- + 17 +(1 row) + +SELECT POSITION(B'111010110' IN B'000000000011101011111010110'); -- 19 + position +---------- + 19 +(1 row) + +SELECT POSITION(B'000000000011101011111010110' IN B'000000000011101011111010110'); -- 1 + position +---------- + 1 +(1 row) + +SELECT POSITION(B'00000000011101011111010110' IN B'000000000011101011111010110'); -- 2 + position +---------- + 2 +(1 row) + +SELECT POSITION(B'0000000000011101011111010110' IN B'000000000011101011111010110'); -- 0 + position +---------- + 0 +(1 row) + +-- Shifting +CREATE TABLE BIT_SHIFT_TABLE(b BIT(16)); +INSERT INTO BIT_SHIFT_TABLE VALUES (B'1101100000000000'); +INSERT INTO BIT_SHIFT_TABLE SELECT b>>1 FROM BIT_SHIFT_TABLE; +INSERT INTO BIT_SHIFT_TABLE SELECT b>>2 FROM BIT_SHIFT_TABLE; +INSERT INTO BIT_SHIFT_TABLE SELECT b>>4 FROM BIT_SHIFT_TABLE; +INSERT INTO BIT_SHIFT_TABLE SELECT b>>8 FROM BIT_SHIFT_TABLE; +SELECT POSITION(B'1101' IN b), + POSITION(B'11011' IN b), + b + FROM BIT_SHIFT_TABLE ORDER BY b; + position | position | b +----------+----------+------------------ + 11 | 11 | 0000000000110110 + 9 | 9 | 0000000011011000 + 3 | 3 | 0011011000000000 + 1 | 1 | 1101100000000000 +(4 rows) + +CREATE TABLE VARBIT_SHIFT_TABLE(v BIT VARYING(20)); +INSERT INTO VARBIT_SHIFT_TABLE VALUES (B'11011'); +INSERT INTO VARBIT_SHIFT_TABLE SELECT CAST(v || B'0' AS BIT VARYING(6)) >>1 FROM VARBIT_SHIFT_TABLE; +INSERT INTO VARBIT_SHIFT_TABLE SELECT CAST(v || B'00' AS BIT VARYING(8)) >>2 FROM VARBIT_SHIFT_TABLE; +INSERT INTO VARBIT_SHIFT_TABLE SELECT CAST(v || B'0000' AS BIT VARYING(12)) >>4 FROM VARBIT_SHIFT_TABLE; +INSERT INTO VARBIT_SHIFT_TABLE SELECT CAST(v || B'00000000' AS BIT VARYING(20)) >>8 FROM VARBIT_SHIFT_TABLE; +SELECT POSITION(B'1101' IN v), + POSITION(B'11011' IN v), + v + FROM VARBIT_SHIFT_TABLE ORDER BY v; + position | position | v +----------+----------+----------------- + 11 | 11 | 000000000011011 + 9 | 9 | 0000000011011 + 3 | 3 | 0011011 + 1 | 1 | 11011 +(4 rows) + +DROP TABLE BIT_SHIFT_TABLE; +DROP TABLE VARBIT_SHIFT_TABLE; +-- Get/Set bit +SELECT get_bit(B'0101011000100', 10); + get_bit +--------- + 1 +(1 row) + +SELECT set_bit(B'0101011000100100', 15, 1); + set_bit +------------------ + 0101011000100101 +(1 row) + +SELECT set_bit(B'0101011000100100', 16, 1); -- fail +ERROR: bit index 16 out of valid range (0..15) +-- Overlay +SELECT overlay(B'0101011100' placing '001' from 2 for 3); + overlay +------------ + 0001011100 +(1 row) + +SELECT overlay(B'0101011100' placing '101' from 6); + overlay +------------ + 0101010100 +(1 row) + +SELECT overlay(B'0101011100' placing '001' from 11); + overlay +--------------- + 0101011100001 +(1 row) + +SELECT overlay(B'0101011100' placing '001' from 20); + overlay +--------------- + 0101011100001 +(1 row) + ----------------------------------------------------------------------- Summary of changes: src/test/regress/expected/{bit.out => bit_1.out} | 32 +++------------------- 1 files changed, 4 insertions(+), 28 deletions(-) copy src/test/regress/expected/{bit.out => bit_1.out} (94%) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-04-11 05:40:34
|
Project "Postgres-XC". The branch, master has been updated via 000557b15b4468cdf6ee1f9e5d8da977c42942ce (commit) from b53f7e7bdc5cc827e332f655c73ac7334e9a162d (commit) - Log ----------------------------------------------------------------- commit 000557b15b4468cdf6ee1f9e5d8da977c42942ce Author: Michael P <mic...@us...> Date: Mon Apr 11 14:33:48 2011 +0900 Fix for bug 3141542: table referencing to itself In case a table references to itself, check if relation name is the same for the relation in the constraint when enforcing local constraints. Then a check is done on schema names to be sure that reference and table are on the same schema. diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c index 9b48756..cbbb888 100644 --- a/src/backend/parser/parse_utilcmd.c +++ b/src/backend/parser/parse_utilcmd.c @@ -2555,13 +2555,48 @@ checkLocalFKConstraints(CreateStmtContext *cxt) char *checkcolname = NULL; fkconstraint = (Constraint *) lfirst(fkclist); + + /* + * If constraint references to the table itself, it is safe + * Check if relation name is the same + */ + if (fkconstraint->pktable && + strcmp(fkconstraint->pktable->relname,cxt->relation->relname) == 0) + { + /* Is namespace also the same ? */ + char *fkcon_schemaname = NULL; + + if (!cxt->relation->schemaname && + !fkconstraint->pktable->schemaname) + continue; + + if (!fkconstraint->pktable->schemaname) + { + /* Schema name is not defined, look for current one */ + List *search_path = fetch_search_path(false); + fkcon_schemaname = get_namespace_name(linitial_oid(search_path)); + list_free(search_path); + } + else + fkcon_schemaname = fkconstraint->pktable->schemaname; + + /* + * If schema name and relation name are the same, table + * references to itself, so constraint is safe + */ + if (fkcon_schemaname && + strcmp(fkcon_schemaname, + cxt->relation->schemaname) == 0) + continue; + } + pk_rel_id = RangeVarGetRelid(fkconstraint->pktable, false); refloctype = GetLocatorType(pk_rel_id); /* If referenced table is replicated, the constraint is safe */ if (refloctype == LOCATOR_TYPE_REPLICATED) - continue; + continue; else if (refloctype == LOCATOR_TYPE_RROBIN) { ereport(ERROR, ----------------------------------------------------------------------- Summary of changes: src/backend/parser/parse_utilcmd.c | 37 +++++++++++++++++++++++++++++++++++- 1 files changed, 36 insertions(+), 1 deletions(-) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-04-11 02:05:40
|
Project "Postgres-XC documentation". The branch, REL0_9_4_STABLE has been created at 87e4cff06ed2bd2871ae0a35189e7b633343d6d2 (commit) - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- hooks/post-receive -- Postgres-XC documentation |
From: Michael P. <mic...@us...> - 2011-04-11 02:04:25
|
Project "Postgres-XC documentation". The annotated tag, v0.9.4 has been created at 3839d061ae141d52651f7c00367638bbbeed74e7 (tag) tagging 87e4cff06ed2bd2871ae0a35189e7b633343d6d2 (commit) tagged by Michael P on Mon Apr 11 11:00:52 2011 +0900 - Log ----------------------------------------------------------------- Postgres-XC version 0.9.4 tag Koichi Suzuki (4): This is the first commit of Postgres-XC document. Until Postgres-XC 0.9.3, Added new directory for progress reporting document, "progress". 1. Added 2011FYQ1 schedule for each member. Changed Koichi's schedule for May and June. Michael P (1): Correction of documentation and manuals for release 0.9.4 ----------------------------------------------------------------------- hooks/post-receive -- Postgres-XC documentation |
From: Michael P. <mic...@us...> - 2011-04-11 02:01:57
|
Project "Postgres-XC documentation". The branch, master has been updated via 87e4cff06ed2bd2871ae0a35189e7b633343d6d2 (commit) from 4c8c9a83834b9513848c2040596a5d310d432e57 (commit) - Log ----------------------------------------------------------------- commit 87e4cff06ed2bd2871ae0a35189e7b633343d6d2 Author: Michael P <mic...@us...> Date: Mon Apr 11 10:57:23 2011 +0900 Correction of documentation and manuals for release 0.9.4 Some precisions about new functionalities available, corrections about parameters have been added. diff --git a/PG-XC_Configurator.odt b/PG-XC_Configurator.odt index 0a0e7ba..b560a49 100644 Binary files a/PG-XC_Configurator.odt and b/PG-XC_Configurator.odt differ diff --git a/PG-XC_DBT1_Tutorial.odt b/PG-XC_DBT1_Tutorial.odt index 8a27cf3..9e413a4 100644 Binary files a/PG-XC_DBT1_Tutorial.odt and b/PG-XC_DBT1_Tutorial.odt differ diff --git a/PG-XC_InstallManual.odt b/PG-XC_InstallManual.odt index 8090740..fca6f9f 100644 Binary files a/PG-XC_InstallManual.odt and b/PG-XC_InstallManual.odt differ diff --git a/PG-XC_ReferenceManual.odt b/PG-XC_ReferenceManual.odt index 4922976..7288a56 100644 Binary files a/PG-XC_ReferenceManual.odt and b/PG-XC_ReferenceManual.odt differ diff --git a/PG-XC_SQL_Limitations.odt b/PG-XC_SQL_Limitations.odt index 7d3ff1f..45d3928 100644 Binary files a/PG-XC_SQL_Limitations.odt and b/PG-XC_SQL_Limitations.odt differ diff --git a/PG-XC_pgbench_Tutorial.odt b/PG-XC_pgbench_Tutorial.odt index 78d114c..a537e23 100644 Binary files a/PG-XC_pgbench_Tutorial.odt and b/PG-XC_pgbench_Tutorial.odt differ ----------------------------------------------------------------------- Summary of changes: PG-XC_Configurator.odt | Bin 130305 -> 130255 bytes PG-XC_DBT1_Tutorial.odt | Bin 34886 -> 35088 bytes PG-XC_InstallManual.odt | Bin 47463 -> 47031 bytes PG-XC_ReferenceManual.odt | Bin 38426 -> 38825 bytes PG-XC_SQL_Limitations.odt | Bin 29745 -> 29658 bytes PG-XC_pgbench_Tutorial.odt | Bin 19225 -> 19214 bytes 6 files changed, 0 insertions(+), 0 deletions(-) hooks/post-receive -- Postgres-XC documentation |
From: Michael P. <mic...@us...> - 2011-04-11 00:52:04
|
Project "Postgres-XC". The branch, master has been updated via b53f7e7bdc5cc827e332f655c73ac7334e9a162d (commit) from e137a355b191645ddaf921b5cee2264252a76e8d (commit) - Log ----------------------------------------------------------------- commit b53f7e7bdc5cc827e332f655c73ac7334e9a162d Author: Michael P <mic...@us...> Date: Mon Apr 11 09:46:09 2011 +0900 Delete pgxc_class tuple when dropping a relation Clean-up of pgxc_class, the catalog table containing all the distribution information of cluster tables, was not done when dropping a table. Patch written by Benny Wang diff --git a/src/backend/catalog/dependency.c b/src/backend/catalog/dependency.c index abefa48..48eaeac 100644 --- a/src/backend/catalog/dependency.c +++ b/src/backend/catalog/dependency.c @@ -1275,6 +1275,11 @@ doDeletion(const ObjectAddress *object) case OCLASS_DEFACL: RemoveDefaultACLById(object->objectId); break; +#ifdef PGXC + case OCLASS_PGXC_CLASS: + RemovePgxcClass(object->objectId); + break; +#endif default: elog(ERROR, "unrecognized object class: %u", @@ -2210,6 +2215,11 @@ getObjectClass(const ObjectAddress *object) case DefaultAclRelationId: Assert(object->objectSubId == 0); return OCLASS_DEFACL; +#ifdef PGXC + case PgxcClassRelationId: + Assert(object->objectSubId == 0); + return OCLASS_PGXC_CLASS; +#endif } /* shouldn't get here */ diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c index 8b25ace..34f8dba 100644 --- a/src/backend/catalog/heap.c +++ b/src/backend/catalog/heap.c @@ -830,6 +830,8 @@ AddRelationDistribution (Oid relid, int hashalgorithm = 0; int hashbuckets = 0; AttrNumber attnum = 0; + ObjectAddress myself, + referenced; if (!distributeby) @@ -982,6 +984,17 @@ AddRelationDistribution (Oid relid, } PgxcClassCreate (relid, locatortype, attnum, hashalgorithm, hashbuckets); + + /* Make dependency entries */ + myself.classId = PgxcClassRelationId; + myself.objectId = relid; + myself.objectSubId = 0; + + /* Dependency on relation */ + referenced.classId = RelationRelationId; + referenced.objectId = relid; + referenced.objectSubId = 0; + recordDependencyOn(&myself, &referenced, DEPENDENCY_INTERNAL); } #endif diff --git a/src/backend/utils/cache/syscache.c b/src/backend/utils/cache/syscache.c index 9050357..6a538fc 100644 --- a/src/backend/utils/cache/syscache.c +++ b/src/backend/utils/cache/syscache.c @@ -506,7 +506,7 @@ static const struct cachedesc cacheinfo[] = { PgxcClassPgxcRelIdIndexId, 1, { - ObjectIdAttributeNumber, + Anum_pgxc_class_pcrelid, 0, 0, 0 ----------------------------------------------------------------------- Summary of changes: src/backend/catalog/dependency.c | 10 ++++++++++ src/backend/catalog/heap.c | 13 +++++++++++++ src/backend/utils/cache/syscache.c | 2 +- 3 files changed, 24 insertions(+), 1 deletions(-) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-04-11 00:05:55
|
Project "Postgres-XC". The branch, master has been updated via e137a355b191645ddaf921b5cee2264252a76e8d (commit) from 43675e5f56beb98419514bd23997bc178e005a6f (commit) - Log ----------------------------------------------------------------- commit e137a355b191645ddaf921b5cee2264252a76e8d Author: Michael P <mic...@us...> Date: Mon Apr 11 08:52:22 2011 +0900 Fix for bug 3237820: rules on views Views are only created on Coordinator, so if a rule is defined on a view this query is only launched on Coordinators. A query that drops a rule defined on a view also is launched only on Coordinators. diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index 8408b40..28a43c2 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -1240,8 +1240,19 @@ standard_ProcessUtility(Node *parsetree, case T_RuleStmt: /* CREATE RULE */ DefineRule((RuleStmt *) parsetree, queryString); #ifdef PGXC - if (IS_PGXC_COORDINATOR) - ExecUtilityStmtOnNodes(queryString, NULL, false, EXEC_ON_ALL_NODES); + /* If a rule is created on a view, define it only on Coordinator */ + if (IS_PGXC_COORDINATOR && !IsConnFromCoord()) + { + RemoteQueryExecType remoteExecType; + Oid relid = RangeVarGetRelid(((RuleStmt *) parsetree)->relation, false); + + if (get_rel_relkind(relid) == RELKIND_VIEW) + remoteExecType = EXEC_ON_COORDS; + else + remoteExecType = EXEC_ON_ALL_NODES; + + ExecUtilityStmtOnNodes(queryString, NULL, false, remoteExecType); + } #endif break; @@ -1472,11 +1483,30 @@ standard_ProcessUtility(Node *parsetree, /* RemoveRewriteRule checks permissions */ RemoveRewriteRule(relId, stmt->property, stmt->behavior, stmt->missing_ok); +#ifdef PGXC + /* If rule is defined on a view, drop it only on Coordinators */ + if (IS_PGXC_COORDINATOR && !IsConnFromCoord()) + { + RemoteQueryExecType remoteExecType; + Oid relid = RangeVarGetRelid(stmt->relation, false); + + if (get_rel_relkind(relid) == RELKIND_VIEW) + remoteExecType = EXEC_ON_COORDS; + else + remoteExecType = EXEC_ON_ALL_NODES; + + ExecUtilityStmtOnNodes(queryString, NULL, false, remoteExecType); + } +#endif break; case OBJECT_TRIGGER: /* DropTrigger checks permissions */ DropTrigger(relId, stmt->property, stmt->behavior, stmt->missing_ok); +#ifdef PGXC + if (IS_PGXC_COORDINATOR) + ExecUtilityStmtOnNodes(queryString, NULL, false, EXEC_ON_ALL_NODES); +#endif break; default: elog(ERROR, "unrecognized object type: %d", @@ -1484,10 +1514,6 @@ standard_ProcessUtility(Node *parsetree, break; } } -#ifdef PGXC - if (IS_PGXC_COORDINATOR) - ExecUtilityStmtOnNodes(queryString, NULL, false, EXEC_ON_ALL_NODES); -#endif break; case T_CreatePLangStmt: ----------------------------------------------------------------------- Summary of changes: src/backend/tcop/utility.c | 38 ++++++++++++++++++++++++++++++++------ 1 files changed, 32 insertions(+), 6 deletions(-) hooks/post-receive -- Postgres-XC |