mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
Support writing "CREATE/ALTER TABLE ... SET STORAGE DEFAULT".
We already allow explicitly writing DEFAULT for SET COMPRESSION, so it seems a bit inflexible and non-orthogonal to not have it for STORAGE. Aleksander Alekseev Discussion: https://postgr.es/m/CAJ7c6TMX9ui+6y3TQFaXJYVpZyBukvqhQbVDJ8OUokeLRhtnpA@mail.gmail.com
This commit is contained in:
@ -41,7 +41,7 @@ ALTER FOREIGN TABLE [ IF EXISTS ] <replaceable class="parameter">name</replaceab
|
||||
ALTER [ COLUMN ] <replaceable class="parameter">column_name</replaceable> SET STATISTICS <replaceable class="parameter">integer</replaceable>
|
||||
ALTER [ COLUMN ] <replaceable class="parameter">column_name</replaceable> SET ( <replaceable class="parameter">attribute_option</replaceable> = <replaceable class="parameter">value</replaceable> [, ... ] )
|
||||
ALTER [ COLUMN ] <replaceable class="parameter">column_name</replaceable> RESET ( <replaceable class="parameter">attribute_option</replaceable> [, ... ] )
|
||||
ALTER [ COLUMN ] <replaceable class="parameter">column_name</replaceable> SET STORAGE { PLAIN | EXTERNAL | EXTENDED | MAIN }
|
||||
ALTER [ COLUMN ] <replaceable class="parameter">column_name</replaceable> SET STORAGE { PLAIN | EXTERNAL | EXTENDED | MAIN | DEFAULT }
|
||||
ALTER [ COLUMN ] <replaceable class="parameter">column_name</replaceable> OPTIONS ( [ ADD | SET | DROP ] <replaceable class="parameter">option</replaceable> ['<replaceable class="parameter">value</replaceable>'] [, ... ])
|
||||
ADD <replaceable class="parameter">table_constraint</replaceable> [ NOT VALID ]
|
||||
VALIDATE CONSTRAINT <replaceable class="parameter">constraint_name</replaceable>
|
||||
|
@ -39,7 +39,7 @@ ALTER MATERIALIZED VIEW ALL IN TABLESPACE <replaceable class="parameter">name</r
|
||||
ALTER [ COLUMN ] <replaceable class="parameter">column_name</replaceable> SET STATISTICS <replaceable class="parameter">integer</replaceable>
|
||||
ALTER [ COLUMN ] <replaceable class="parameter">column_name</replaceable> SET ( <replaceable class="parameter">attribute_option</replaceable> = <replaceable class="parameter">value</replaceable> [, ... ] )
|
||||
ALTER [ COLUMN ] <replaceable class="parameter">column_name</replaceable> RESET ( <replaceable class="parameter">attribute_option</replaceable> [, ... ] )
|
||||
ALTER [ COLUMN ] <replaceable class="parameter">column_name</replaceable> SET STORAGE { PLAIN | EXTERNAL | EXTENDED | MAIN }
|
||||
ALTER [ COLUMN ] <replaceable class="parameter">column_name</replaceable> SET STORAGE { PLAIN | EXTERNAL | EXTENDED | MAIN | DEFAULT }
|
||||
ALTER [ COLUMN ] <replaceable class="parameter">column_name</replaceable> SET COMPRESSION <replaceable class="parameter">compression_method</replaceable>
|
||||
CLUSTER ON <replaceable class="parameter">index_name</replaceable>
|
||||
SET WITHOUT CLUSTER
|
||||
|
@ -53,7 +53,7 @@ ALTER TABLE [ IF EXISTS ] <replaceable class="parameter">name</replaceable>
|
||||
ALTER [ COLUMN ] <replaceable class="parameter">column_name</replaceable> SET STATISTICS <replaceable class="parameter">integer</replaceable>
|
||||
ALTER [ COLUMN ] <replaceable class="parameter">column_name</replaceable> SET ( <replaceable class="parameter">attribute_option</replaceable> = <replaceable class="parameter">value</replaceable> [, ... ] )
|
||||
ALTER [ COLUMN ] <replaceable class="parameter">column_name</replaceable> RESET ( <replaceable class="parameter">attribute_option</replaceable> [, ... ] )
|
||||
ALTER [ COLUMN ] <replaceable class="parameter">column_name</replaceable> SET STORAGE { PLAIN | EXTERNAL | EXTENDED | MAIN }
|
||||
ALTER [ COLUMN ] <replaceable class="parameter">column_name</replaceable> SET STORAGE { PLAIN | EXTERNAL | EXTENDED | MAIN | DEFAULT }
|
||||
ALTER [ COLUMN ] <replaceable class="parameter">column_name</replaceable> SET COMPRESSION <replaceable class="parameter">compression_method</replaceable>
|
||||
ADD <replaceable class="parameter">table_constraint</replaceable> [ NOT VALID ]
|
||||
ADD <replaceable class="parameter">table_constraint_using_index</replaceable>
|
||||
@ -367,7 +367,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>SET STORAGE { PLAIN | EXTERNAL | EXTENDED | MAIN }</literal>
|
||||
<literal>SET STORAGE { PLAIN | EXTERNAL | EXTENDED | MAIN | DEFAULT }</literal>
|
||||
<indexterm>
|
||||
<primary>TOAST</primary>
|
||||
<secondary>per-column storage settings</secondary>
|
||||
@ -376,20 +376,24 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
|
||||
<listitem>
|
||||
<para>
|
||||
This form sets the storage mode for a column. This controls whether this
|
||||
column is held inline or in a secondary <acronym>TOAST</acronym> table, and
|
||||
whether the data
|
||||
column is held inline or in a secondary <acronym>TOAST</acronym> table,
|
||||
and whether the data
|
||||
should be compressed or not. <literal>PLAIN</literal> must be used
|
||||
for fixed-length values such as <type>integer</type> and is
|
||||
inline, uncompressed. <literal>MAIN</literal> is for inline,
|
||||
compressible data. <literal>EXTERNAL</literal> is for external,
|
||||
uncompressed data, and <literal>EXTENDED</literal> is for external,
|
||||
compressed data. <literal>EXTENDED</literal> is the default for most
|
||||
data types that support non-<literal>PLAIN</literal> storage.
|
||||
compressed data.
|
||||
Writing <literal>DEFAULT</literal> sets the storage mode to the default
|
||||
mode for the column's data type. <literal>EXTENDED</literal> is the
|
||||
default for most data types that support non-<literal>PLAIN</literal>
|
||||
storage.
|
||||
Use of <literal>EXTERNAL</literal> will make substring operations on
|
||||
very large <type>text</type> and <type>bytea</type> values run faster,
|
||||
at the penalty of increased storage space. Note that
|
||||
<literal>SET STORAGE</literal> doesn't itself change anything in the table,
|
||||
it just sets the strategy to be pursued during future table updates.
|
||||
at the penalty of increased storage space.
|
||||
Note that <literal>ALTER TABLE ... SET STORAGE</literal> doesn't itself
|
||||
change anything in the table; it just sets the strategy to be pursued
|
||||
during future table updates.
|
||||
See <xref linkend="storage-toast"/> for more information.
|
||||
</para>
|
||||
</listitem>
|
||||
|
@ -22,7 +22,7 @@ PostgreSQL documentation
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXISTS ] <replaceable class="parameter">table_name</replaceable> ( [
|
||||
{ <replaceable class="parameter">column_name</replaceable> <replaceable class="parameter">data_type</replaceable> [ STORAGE { PLAIN | EXTERNAL | EXTENDED | MAIN } ] [ COMPRESSION <replaceable>compression_method</replaceable> ] [ COLLATE <replaceable>collation</replaceable> ] [ <replaceable class="parameter">column_constraint</replaceable> [ ... ] ]
|
||||
{ <replaceable class="parameter">column_name</replaceable> <replaceable class="parameter">data_type</replaceable> [ STORAGE { PLAIN | EXTERNAL | EXTENDED | MAIN | DEFAULT } ] [ COMPRESSION <replaceable>compression_method</replaceable> ] [ COLLATE <replaceable>collation</replaceable> ] [ <replaceable class="parameter">column_constraint</replaceable> [ ... ] ]
|
||||
| <replaceable>table_constraint</replaceable>
|
||||
| LIKE <replaceable>source_table</replaceable> [ <replaceable>like_option</replaceable> ... ] }
|
||||
[, ... ]
|
||||
@ -299,7 +299,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>STORAGE { PLAIN | EXTERNAL | EXTENDED | MAIN }</literal>
|
||||
<literal>STORAGE { PLAIN | EXTERNAL | EXTENDED | MAIN | DEFAULT }</literal>
|
||||
<indexterm>
|
||||
<primary>TOAST</primary>
|
||||
<secondary>per-column storage settings</secondary>
|
||||
@ -314,12 +314,14 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
|
||||
inline, uncompressed. <literal>MAIN</literal> is for inline, compressible
|
||||
data. <literal>EXTERNAL</literal> is for external, uncompressed data, and
|
||||
<literal>EXTENDED</literal> is for external, compressed data.
|
||||
<literal>EXTENDED</literal> is the default for most data types that
|
||||
support non-<literal>PLAIN</literal> storage. Use of
|
||||
<literal>EXTERNAL</literal> will make substring operations on very large
|
||||
<type>text</type> and <type>bytea</type> values run faster, at the penalty
|
||||
of increased storage space. See <xref linkend="storage-toast"/> for more
|
||||
information.
|
||||
Writing <literal>DEFAULT</literal> sets the storage mode to the default
|
||||
mode for the column's data type. <literal>EXTENDED</literal> is the
|
||||
default for most data types that support non-<literal>PLAIN</literal>
|
||||
storage.
|
||||
Use of <literal>EXTERNAL</literal> will make substring operations on
|
||||
very large <type>text</type> and <type>bytea</type> values run faster,
|
||||
at the penalty of increased storage space.
|
||||
See <xref linkend="storage-toast"/> for more information.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
Reference in New Issue
Block a user