diff options
Diffstat (limited to 'doc/src/sgml/ref/create_sequence.sgml')
-rw-r--r-- | doc/src/sgml/ref/create_sequence.sgml | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/doc/src/sgml/ref/create_sequence.sgml b/doc/src/sgml/ref/create_sequence.sgml index 20bdbc002fa..a84aa5bf56a 100644 --- a/doc/src/sgml/ref/create_sequence.sgml +++ b/doc/src/sgml/ref/create_sequence.sgml @@ -21,7 +21,7 @@ PostgreSQL documentation <refsynopsisdiv> <synopsis> -CREATE [ TEMPORARY | TEMP ] SEQUENCE [ IF NOT EXISTS ] <replaceable class="parameter">name</replaceable> +CREATE [ { TEMPORARY | TEMP } | UNLOGGED ] SEQUENCE [ IF NOT EXISTS ] <replaceable class="parameter">name</replaceable> [ AS <replaceable class="parameter">data_type</replaceable> ] [ INCREMENT [ BY ] <replaceable class="parameter">increment</replaceable> ] [ MINVALUE <replaceable class="parameter">minvalue</replaceable> | NO MINVALUE ] [ MAXVALUE <replaceable class="parameter">maxvalue</replaceable> | NO MAXVALUE ] @@ -93,6 +93,27 @@ SELECT * FROM <replaceable>name</replaceable>; </varlistentry> <varlistentry> + <term><literal>UNLOGGED</literal></term> + <listitem> + <para> + If specified, the sequence is created as an unlogged sequence. Changes + to unlogged sequences are not written to the write-ahead log. They are + not crash-safe: an unlogged sequence is automatically reset to its + initial state after a crash or unclean shutdown. Unlogged sequences are + also not replicated to standby servers. + </para> + + <para> + Unlike unlogged tables, unlogged sequences do not offer a significant + performance advantage. This option is mainly intended for sequences + associated with unlogged tables via identity columns or serial columns. + In those cases, it usually wouldn't make sense to have the sequence + WAL-logged and replicated but not its associated table. + </para> + </listitem> + </varlistentry> + + <varlistentry> <term><literal>IF NOT EXISTS</literal></term> <listitem> <para> |