From: Shigeru Hanada Date: Tue, 5 Jul 2011 04:58:04 +0000 (+0900) Subject: Merge branch 'master' into per_column_option X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=971dee43a78ae3363ba835bf571a299c6193851c;p=users%2Fhanada%2Fpostgres.git Merge branch 'master' into per_column_option --- 971dee43a78ae3363ba835bf571a299c6193851c diff --cc src/test/regress/expected/foreign_data.out index a298a9ce26,2b3eddfc8b..45292b5fde --- a/src/test/regress/expected/foreign_data.out +++ b/src/test/regress/expected/foreign_data.out @@@ -694,31 -694,10 +694,31 @@@ ALTER FOREIGN TABLE ft1 ALTER COLUMN c ERROR: "ft1" is not a table or view ALTER FOREIGN TABLE ft1 ALTER COLUMN c6 SET NOT NULL; ALTER FOREIGN TABLE ft1 ALTER COLUMN c7 DROP NOT NULL; - ALTER FOREIGN TABLE ft1 ALTER COLUMN c8 TYPE char(10) using '0'; -- ERROR - ERROR: ALTER TYPE USING is only supported on plain tables + ALTER FOREIGN TABLE ft1 ALTER COLUMN c8 TYPE char(10) USING '0'; -- ERROR + ERROR: "ft1" is not a table ALTER FOREIGN TABLE ft1 ALTER COLUMN c8 TYPE char(10); ALTER FOREIGN TABLE ft1 ALTER COLUMN c8 SET DATA TYPE text; +ALTER FOREIGN TABLE ft1 ALTER COLUMN xmin OPTIONS (ADD p1 'v1'); -- ERROR +ERROR: cannot alter system column "xmin" +ALTER FOREIGN TABLE ft1 ALTER COLUMN c7 OPTIONS (ADD p1 'v1', ADD p2 'v2'), + ALTER COLUMN c8 OPTIONS (ADD p1 'v1', ADD p2 'v2'); +ALTER FOREIGN TABLE ft1 ALTER COLUMN c8 OPTIONS (SET p2 'V2', DROP p1); +\d+ ft1 + Foreign table "public.ft1" + Column | Type | Modifiers | Options | Storage | Description +--------+---------+-----------+---------------------------+----------+------------- + c1 | integer | not null | {param1=val1} | plain | + c2 | text | | {param2=val2,param3=val3} | extended | + c3 | date | | | plain | + c4 | integer | | | plain | + c6 | integer | not null | | plain | + c7 | integer | | {p1=v1,p2=v2} | plain | + c8 | text | | {p2=V2} | extended | + c9 | integer | | | plain | + c10 | integer | | {p1=v1} | plain | +Server: sc +Has OIDs: no + -- can't change the column type if it's used elsewhere CREATE TABLE use_ft1_column_type (x ft1); ALTER FOREIGN TABLE ft1 ALTER COLUMN c8 SET DATA TYPE integer; -- ERROR diff --cc src/test/regress/sql/foreign_data.sql index 5d9b24ae9c,58e5060477..b3b49cc2e3 --- a/src/test/regress/sql/foreign_data.sql +++ b/src/test/regress/sql/foreign_data.sql @@@ -294,14 -294,9 +294,14 @@@ ALTER FOREIGN TABLE ft1 ALTER COLUMN c ALTER FOREIGN TABLE ft1 ALTER COLUMN c5 DROP DEFAULT; -- ERROR ALTER FOREIGN TABLE ft1 ALTER COLUMN c6 SET NOT NULL; ALTER FOREIGN TABLE ft1 ALTER COLUMN c7 DROP NOT NULL; - ALTER FOREIGN TABLE ft1 ALTER COLUMN c8 TYPE char(10) using '0'; -- ERROR + ALTER FOREIGN TABLE ft1 ALTER COLUMN c8 TYPE char(10) USING '0'; -- ERROR ALTER FOREIGN TABLE ft1 ALTER COLUMN c8 TYPE char(10); ALTER FOREIGN TABLE ft1 ALTER COLUMN c8 SET DATA TYPE text; +ALTER FOREIGN TABLE ft1 ALTER COLUMN xmin OPTIONS (ADD p1 'v1'); -- ERROR +ALTER FOREIGN TABLE ft1 ALTER COLUMN c7 OPTIONS (ADD p1 'v1', ADD p2 'v2'), + ALTER COLUMN c8 OPTIONS (ADD p1 'v1', ADD p2 'v2'); +ALTER FOREIGN TABLE ft1 ALTER COLUMN c8 OPTIONS (SET p2 'V2', DROP p1); +\d+ ft1 -- can't change the column type if it's used elsewhere CREATE TABLE use_ft1_column_type (x ft1); ALTER FOREIGN TABLE ft1 ALTER COLUMN c8 SET DATA TYPE integer; -- ERROR