From 784cedda0604ee4ac731fd0b00cd8b27e78c02d3 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 13 Jul 2022 12:21:45 +0200 Subject: Allow specifying STORAGE attribute for a new table Previously, the STORAGE specification was only available in ALTER TABLE. This makes it available in CREATE TABLE as well. Also make the code and the documentation for STORAGE and COMPRESSION attributes consistent. Author: Teodor Sigaev Author: Aleksander Alekseev Reviewed-by: Peter Eisentraut Reviewed-by: wenjing zeng Reviewed-by: Matthias van de Meent Reviewed-by: Kyotaro Horiguchi Discussion: https://postgr.es/m/de83407a-ae3d-a8e1-a788-920eb334f25b@sigaev.ru --- doc/src/sgml/ref/alter_table.sgml | 2 +- doc/src/sgml/ref/create_table.sgml | 29 ++++++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml index a3c62bf056e..f0f912a56c5 100644 --- a/doc/src/sgml/ref/alter_table.sgml +++ b/doc/src/sgml/ref/alter_table.sgml @@ -367,7 +367,7 @@ WITH ( MODULUS numeric_literal, REM - SET STORAGE + SET STORAGE { PLAIN | EXTERNAL | EXTENDED | MAIN } TOAST per-column storage settings diff --git a/doc/src/sgml/ref/create_table.sgml b/doc/src/sgml/ref/create_table.sgml index 6c9918b0a1e..6bbf15ed1a4 100644 --- a/doc/src/sgml/ref/create_table.sgml +++ b/doc/src/sgml/ref/create_table.sgml @@ -22,7 +22,7 @@ PostgreSQL documentation CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXISTS ] table_name ( [ - { column_name data_type [ COMPRESSION compression_method ] [ COLLATE collation ] [ column_constraint [ ... ] ] + { column_name data_type [ STORAGE { PLAIN | EXTERNAL | EXTENDED | MAIN } ] [ COMPRESSION compression_method ] [ COLLATE collation ] [ column_constraint [ ... ] ] | table_constraint | LIKE source_table [ like_option ... ] } [, ... ] @@ -297,6 +297,33 @@ WITH ( MODULUS numeric_literal, REM + + + STORAGE { PLAIN | EXTERNAL | EXTENDED | MAIN } + + TOAST + per-column storage settings + + + + + This form sets the storage mode for the column. This controls whether this + column is held inline or in a secondary TOAST table, + and whether the data should be compressed or not. PLAIN + must be used for fixed-length values such as integer and is + inline, uncompressed. MAIN is for inline, compressible + data. EXTERNAL is for external, uncompressed data, and + EXTENDED is for external, compressed data. + EXTENDED is the default for most data types that + support non-PLAIN storage. Use of + EXTERNAL will make substring operations on very large + text and bytea values run faster, at the penalty + of increased storage space. See for more + information. + + + + COMPRESSION compression_method -- cgit v1.2.3