diff options
Diffstat (limited to 'doc/src/sgml/ref/create_foreign_table.sgml')
-rw-r--r-- | doc/src/sgml/ref/create_foreign_table.sgml | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/doc/src/sgml/ref/create_foreign_table.sgml b/doc/src/sgml/ref/create_foreign_table.sgml index 413b033cb57..5d0dcf567b5 100644 --- a/doc/src/sgml/ref/create_foreign_table.sgml +++ b/doc/src/sgml/ref/create_foreign_table.sgml @@ -27,6 +27,15 @@ CREATE FOREIGN TABLE [ IF NOT EXISTS ] <replaceable class="PARAMETER">table_name SERVER <replaceable class="parameter">server_name</replaceable> [ OPTIONS ( <replaceable class="PARAMETER">option</replaceable> '<replaceable class="PARAMETER">value</replaceable>' [, ... ] ) ] +CREATE FOREIGN TABLE [ IF NOT EXISTS ] <replaceable class="PARAMETER">table_name</replaceable> + PARTITION OF <replaceable class="PARAMETER">parent_table</replaceable> [ ( + { <replaceable class="PARAMETER">column_name</replaceable> WITH OPTIONS [ <replaceable class="PARAMETER">column_constraint</replaceable> [ ... ] ] + | <replaceable>table_constraint</replaceable> } + [, ... ] +) ] <replaceable class="PARAMETER">partition_bound_spec</replaceable> + SERVER <replaceable class="parameter">server_name</replaceable> +[ OPTIONS ( <replaceable class="PARAMETER">option</replaceable> '<replaceable class="PARAMETER">value</replaceable>' [, ... ] ) ] + <phrase>where <replaceable class="PARAMETER">column_constraint</replaceable> is:</phrase> [ CONSTRAINT <replaceable class="PARAMETER">constraint_name</replaceable> ] @@ -68,6 +77,12 @@ CHECK ( <replaceable class="PARAMETER">expression</replaceable> ) [ NO INHERIT ] </para> <para> + If <literal>PARTITION OF</literal> clause is specified then the table is + created as a partition of <literal>parent_table</literal> with specified + bounds. + </para> + + <para> To be able to create a foreign table, you must have <literal>USAGE</literal> privilege on the foreign server, as well as <literal>USAGE</literal> privilege on all column types used in the table. @@ -314,6 +329,17 @@ CREATE FOREIGN TABLE films ( SERVER film_server; </programlisting></para> + <para> + Create foreign table <structname>measurement_y2016m07</>, which will be + accessed through the server <structname>server_07</>, as a partition + of the range partitioned table <structname>measurement</>: + +<programlisting> +CREATE FOREIGN TABLE measurement_y2016m07 + PARTITION OF measurement FOR VALUES FROM ('2016-07-01') TO ('2016-08-01') + SERVER server_07; +</programlisting></para> + </refsect1> <refsect1 id="SQL-CREATEFOREIGNTABLE-compatibility"> |