From c4096c76399ad99dce35cd62f60599ea8748a3dd Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Fri, 5 Aug 2011 13:24:03 -0400 Subject: Allow per-column foreign data wrapper options. Shigeru Hanada, with fairly minor editing by me. --- doc/src/sgml/catalogs.sgml | 9 +++++ doc/src/sgml/information_schema.sgml | 63 ++++++++++++++++++++++++++++++ doc/src/sgml/ref/alter_foreign_table.sgml | 10 +++-- doc/src/sgml/ref/create_foreign_table.sgml | 8 ++-- doc/src/sgml/ref/psql-ref.sgml | 6 +++ 5 files changed, 89 insertions(+), 7 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml index 5e5f8a75547..6d5dad369d7 100644 --- a/doc/src/sgml/catalogs.sgml +++ b/doc/src/sgml/catalogs.sgml @@ -1157,6 +1157,15 @@ + + attfdwoptions + text[] + + + Attribute-level foreign data wrapper options, as keyword=value strings + + + diff --git a/doc/src/sgml/information_schema.sgml b/doc/src/sgml/information_schema.sgml index ed4f1572a0a..0f0cbfaa83a 100644 --- a/doc/src/sgml/information_schema.sgml +++ b/doc/src/sgml/information_schema.sgml @@ -1018,6 +1018,69 @@ + + <literal>column_options</literal> + + + The view column_options contains all the + options defined for foreign table columns in the current database. Only + those foreign table columns are shown that the current user has access to + (by way of being the owner or having some privilege). + + + + <literal>column_options</literal> Columns + + + + + Name + Data Type + Description + + + + + + table_catalog + sql_identifier + Name of the database that contains the foreign table (always the current database) + + + + table_schema + sql_identifier + Name of the schema that contains the foreign table + + + + table_name + sql_identifier + Name of the foreign table + + + + column_name + sql_identifier + Name of the column + + + + option_name + sql_identifier + Name of an option + + + + option_value + character_data + Value of the option + + + +
+
+ <literal>column_privileges</literal> diff --git a/doc/src/sgml/ref/alter_foreign_table.sgml b/doc/src/sgml/ref/alter_foreign_table.sgml index a45df020ea1..a422c88a4f6 100644 --- a/doc/src/sgml/ref/alter_foreign_table.sgml +++ b/doc/src/sgml/ref/alter_foreign_table.sgml @@ -36,6 +36,7 @@ ALTER FOREIGN TABLE name DROP [ COLUMN ] [ IF EXISTS ] column [ RESTRICT | CASCADE ] ALTER [ COLUMN ] column [ SET DATA ] TYPE type ALTER [ COLUMN ] column { SET | DROP } NOT NULL + ALTER [ COLUMN ] column OPTIONS ( [ ADD | SET | DROP ] option ['value'] [, ... ]) OWNER TO new_owner OPTIONS ( [ ADD | SET | DROP ] option ['value'] [, ... ]) @@ -125,12 +126,13 @@ ALTER FOREIGN TABLE name OPTIONS ( [ ADD | SET | DROP ] option ['value'] [, ... ] ) - Change options for the foreign table. + Change options for the foreign table or one of its columns. ADD, SET, and DROP specify the action to be performed. ADD is assumed - if no operation is explicitly specified. Option names must be - unique; names and values are also validated using the foreign - data wrapper library. + if no operation is explicitly specified. Duplicate option names are not + allowed (although it's OK for a table option and a column option to have + the same name). Option names and values are also validated using the + foreign data wrapper library. diff --git a/doc/src/sgml/ref/create_foreign_table.sgml b/doc/src/sgml/ref/create_foreign_table.sgml index ad91072bd12..5e58fb8c5eb 100644 --- a/doc/src/sgml/ref/create_foreign_table.sgml +++ b/doc/src/sgml/ref/create_foreign_table.sgml @@ -19,7 +19,7 @@ CREATE FOREIGN TABLE [ IF NOT EXISTS ] table_name ( [ - { column_name data_type [ NULL | NOT NULL ] } + { column_name data_type [ OPTIONS ( option 'value' [, ... ] ) ] [ NULL | NOT NULL ] } [, ... ] ] ) SERVER server_name @@ -138,10 +138,12 @@ CREATE FOREIGN TABLE [ IF NOT EXISTS ] table_name OPTIONS ( option 'value' [, ...] ) - Options to be associated with the new foreign table. + Options to be associated with the new foreign table or one of its + columns. The allowed option names and values are specific to each foreign data wrapper and are validated using the foreign-data wrapper's - validator function. Option names must be unique. + validator function. Duplicate option names are not allowed (although + it's OK for a table option and a column option to have the same name). diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml index ecfafadc615..98cb6bd24fb 100644 --- a/doc/src/sgml/ref/psql-ref.sgml +++ b/doc/src/sgml/ref/psql-ref.sgml @@ -891,6 +891,12 @@ testdb=> below.) + + For some types of relation, \d shows additional information + for each column: column values for sequences, indexed expression for + indexes and per-column foreign data wrapper options for foreign tables. + + The command form \d+ is identical, except that more information is displayed: any comments associated with the -- cgit v1.2.3