Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit d460c7c

Browse files
committed
doc: Document that sequences can also be extension configuration tables
From: Michael Paquier <michael.paquier@gmail.com>
1 parent 9603a32 commit d460c7c

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

doc/src/sgml/extend.sgml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -698,17 +698,21 @@ SET LOCAL search_path TO @extschema@;
698698

699699
<para>
700700
To solve this problem, an extension's script file can mark a table
701-
it has created as a configuration table, which will cause
702-
<application>pg_dump</> to include the table's contents (not its
703-
definition) in dumps. To do that, call the function
701+
or a sequence it has created as a configuration relation, which will
702+
cause <application>pg_dump</> to include the table's or the sequence's
703+
contents (not its definition) in dumps. To do that, call the function
704704
<function>pg_extension_config_dump(regclass, text)</> after creating the
705-
table, for example
705+
table or the sequence, for example
706706
<programlisting>
707707
CREATE TABLE my_config (key text, value text);
708+
CREATE SEQUENCE my_config_seq;
708709

709710
SELECT pg_catalog.pg_extension_config_dump('my_config', '');
711+
SELECT pg_catalog.pg_extension_config_dump('my_config_seq', '');
710712
</programlisting>
711-
Any number of tables can be marked this way.
713+
Any number of tables or sequences can be marked this way. Sequences
714+
associated with <type>serial</> or <type>bigserial</> columns can
715+
be marked as well.
712716
</para>
713717

714718
<para>
@@ -729,6 +733,11 @@ SELECT pg_catalog.pg_extension_config_dump('my_config', 'WHERE NOT standard_entr
729733
in the rows created by the extension's script.
730734
</para>
731735

736+
<para>
737+
For sequences, the second argument of <function>pg_extension_config_dump</>
738+
has no effect.
739+
</para>
740+
732741
<para>
733742
More complicated situations, such as initially-provided rows that might
734743
be modified by users, can be handled by creating triggers on the
@@ -753,6 +762,12 @@ SELECT pg_catalog.pg_extension_config_dump('my_config', 'WHERE NOT standard_entr
753762
out but the dump will not be able to be restored directly and user
754763
intervention will be required.
755764
</para>
765+
766+
<para>
767+
Sequences associated with <type>serial</> or <type>bigserial</> columns
768+
need to be directly marked to dump their state. Marking their parent
769+
relation is not enough for this purpose.
770+
</para>
756771
</sect2>
757772

758773
<sect2>

0 commit comments

Comments
 (0)