From 0093ac615d5100022f6f17e0ab8259a9c839c978 Mon Sep 17 00:00:00 2001 From: Hari Babu Date: Tue, 2 Apr 2019 16:00:52 +1100 Subject: [PATCH 2/2] Doc updates for pluggable table access method syntax Default_table_access_method GUC CREATE ACCESS METHOD ... TYPE TABLE .. CREATE MATERIALIZED VIEW ... USING heap2 ... CREATE TABLE ... USING heap2 ... CREATE TABLE AS ... USING heap2 ... --- doc/src/sgml/config.sgml | 24 +++++++++++++++++++ doc/src/sgml/ref/create_access_method.sgml | 14 +++++++---- .../sgml/ref/create_materialized_view.sgml | 13 ++++++++++ doc/src/sgml/ref/create_table.sgml | 15 ++++++++++++ doc/src/sgml/ref/create_table_as.sgml | 13 ++++++++++ 5 files changed, 74 insertions(+), 5 deletions(-) diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index d383de2512..e03da43b7d 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -7231,6 +7231,30 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv; + + default_table_access_method (string) + + default_table_access_method configuration parameter + + + + + This parameter specifies the default table access method to use when creating + tables or materialized views if the CREATE command does + not explicitly specify an access method. + + + + The value is either the name of a table access method, or an empty string + to specify using the default table access method of the current database. + If the value does not match the name of any existing table access method, + PostgreSQL will automatically use the default + table access method of the current database. + + + + + default_tablespace (string) diff --git a/doc/src/sgml/ref/create_access_method.sgml b/doc/src/sgml/ref/create_access_method.sgml index 851c5e63be..dae43dbaed 100644 --- a/doc/src/sgml/ref/create_access_method.sgml +++ b/doc/src/sgml/ref/create_access_method.sgml @@ -61,7 +61,8 @@ CREATE ACCESS METHOD name This clause specifies the type of access method to define. - Only INDEX is supported at present. + Only TABLE and INDEX + are supported at present. @@ -75,10 +76,13 @@ CREATE ACCESS METHOD name that represents the access method. The handler function must be declared to take a single argument of type internal, and its return type depends on the type of access method; - for INDEX access methods, it must - be index_am_handler. The C-level API that the handler - function must implement varies depending on the type of access method. - The index access method API is described in . + for TABLE access methods, it must + be table_am_handler and for INDEX + access methods, it must be index_am_handler. + The C-level API that the handler function must implement varies + depending on the type of access method. The table access method API + is described in and the index access method + API is described in . diff --git a/doc/src/sgml/ref/create_materialized_view.sgml b/doc/src/sgml/ref/create_materialized_view.sgml index 7f31ab4d26..754c4194f1 100644 --- a/doc/src/sgml/ref/create_materialized_view.sgml +++ b/doc/src/sgml/ref/create_materialized_view.sgml @@ -23,6 +23,7 @@ PostgreSQL documentation CREATE MATERIALIZED VIEW [ IF NOT EXISTS ] table_name [ (column_name [, ...] ) ] + [ USING method ] [ WITH ( storage_parameter [= value] [, ... ] ) ] [ TABLESPACE tablespace_name ] AS query @@ -85,6 +86,18 @@ CREATE MATERIALIZED VIEW [ IF NOT EXISTS ] table_name + + USING method + + + This clause specifies optional method for the new materialized view; The method should + be of type TABLE. See for more information. + If this option is not specified, the default table access method is chosen for + the new materialized view. See for more information. + + + + WITH ( storage_parameter [= value] [, ... ] ) diff --git a/doc/src/sgml/ref/create_table.sgml b/doc/src/sgml/ref/create_table.sgml index 0fcbc660b3..dcad41b8dd 100644 --- a/doc/src/sgml/ref/create_table.sgml +++ b/doc/src/sgml/ref/create_table.sgml @@ -29,6 +29,7 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXI ] ) [ INHERITS ( parent_table [, ... ] ) ] [ PARTITION BY { RANGE | LIST | HASH } ( { column_name | ( expression ) } [ COLLATE collation ] [ opclass ] [, ... ] ) ] +[ USING method ] [ WITH ( storage_parameter [= value] [, ... ] ) | WITHOUT OIDS ] [ ON COMMIT { PRESERVE ROWS | DELETE ROWS | DROP } ] [ TABLESPACE tablespace_name ] @@ -40,6 +41,7 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXI [, ... ] ) ] [ PARTITION BY { RANGE | LIST | HASH } ( { column_name | ( expression ) } [ COLLATE collation ] [ opclass ] [, ... ] ) ] +[ USING method ] [ WITH ( storage_parameter [= value] [, ... ] ) | WITHOUT OIDS ] [ ON COMMIT { PRESERVE ROWS | DELETE ROWS | DROP } ] [ TABLESPACE tablespace_name ] @@ -51,6 +53,7 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXI [, ... ] ) ] { FOR VALUES partition_bound_spec | DEFAULT } [ PARTITION BY { RANGE | LIST | HASH } ( { column_name | ( expression ) } [ COLLATE collation ] [ opclass ] [, ... ] ) ] +[ USING method ] [ WITH ( storage_parameter [= value] [, ... ] ) | WITHOUT OIDS ] [ ON COMMIT { PRESERVE ROWS | DELETE ROWS | DROP } ] [ TABLESPACE tablespace_name ] @@ -1170,6 +1173,18 @@ WITH ( MODULUS numeric_literal, REM + + USING method + + + This clause specifies optional method for the new table; The method should be + of type TABLE. See for more information. + If this option is not specified, the default table access method is chosen + for the new table. See for more information. + + + + WITH ( storage_parameter [= value] [, ... ] ) diff --git a/doc/src/sgml/ref/create_table_as.sgml b/doc/src/sgml/ref/create_table_as.sgml index 679e8f521e..f807de2c00 100644 --- a/doc/src/sgml/ref/create_table_as.sgml +++ b/doc/src/sgml/ref/create_table_as.sgml @@ -23,6 +23,7 @@ PostgreSQL documentation CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXISTS ] table_name [ (column_name [, ...] ) ] + [ USING method ] [ WITH ( storage_parameter [= value] [, ... ] ) | WITHOUT OIDS ] [ ON COMMIT { PRESERVE ROWS | DELETE ROWS | DROP } ] [ TABLESPACE tablespace_name ] @@ -120,6 +121,18 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXI + + USING method + + + This clause specifies optional method for the new table; The method should be + of type TABLE. See for more information. + If this option is not specified, then the default table access method is chosen + for the new table. see for more information. + + + + WITH ( storage_parameter [= value] [, ... ] ) -- 2.20.1.windows.1