pg_extension_config_dump() function and sequences

Started by Philippe BEAUDOINover 10 years ago5 messagesdocs
Jump to latest
#1Philippe BEAUDOIN
phb.emaj@free.fr

Hi all,

The page "Packaging Related Objects into an Extension" has a third
chapter dealing with "Extension Configuration Tables". A final paragraph
would be useful to explain that:

The pg_extension_config_dump() function can also register sequences, so
that the current properties of the registered sequences are saved by
pg_dump and later restored. The function can support sequences either
explicitely created with an ALTER SEQUENCE statement or implicitely
created when a table contains SERIAL or BIGSERIAL columns. Note that the
sequences associated to SERIAL or BIGSERIAL columns of a configuration
table need to be registered using the pg_extension_config_dump()
function if one wants to restore the properties they had at pg_dump time.

Sorry for my English. This has to be probably reworded a bit.

Best regards.
Philippe Beaudoin.

--
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs

#2Michael Paquier
michael@paquier.xyz
In reply to: Philippe BEAUDOIN (#1)
Re: pg_extension_config_dump() function and sequences

On Wed, Jan 6, 2016 at 5:29 AM, Philippe BEAUDOIN <phb.emaj@free.fr> wrote:

The page "Packaging Related Objects into an Extension" has a third chapter
dealing with "Extension Configuration Tables". A final paragraph would be
useful to explain that:

The pg_extension_config_dump() function can also register sequences, so that
the current properties of the registered sequences are saved by pg_dump and
later restored. The function can support sequences either explicitely
created with an ALTER SEQUENCE statement or implicitely created when a table
contains SERIAL or BIGSERIAL columns. Note that the sequences associated to
SERIAL or BIGSERIAL columns of a configuration table need to be registered
using the pg_extension_config_dump() function if one wants to restore the
properties they had at pg_dump time.

Instead of a single paragraph, perhaps we could make things more
generic like in the attached?
--
Michael

Attachments:

extension-mark-seq-v1.patchbinary/octet-stream; name=extension-mark-seq-v1.patchDownload+20-5
#3Philippe BEAUDOIN
phb.emaj@free.fr
In reply to: Michael Paquier (#2)
Re: pg_extension_config_dump() function and sequences

Le 18/01/2016 07:10, Michael Paquier a écrit :

On Wed, Jan 6, 2016 at 5:29 AM, Philippe BEAUDOIN <phb.emaj@free.fr> wrote:

The page "Packaging Related Objects into an Extension" has a third chapter
dealing with "Extension Configuration Tables". A final paragraph would be
useful to explain that:

The pg_extension_config_dump() function can also register sequences, so that
the current properties of the registered sequences are saved by pg_dump and
later restored. The function can support sequences either explicitely
created with an ALTER SEQUENCE statement or implicitely created when a table
contains SERIAL or BIGSERIAL columns. Note that the sequences associated to
SERIAL or BIGSERIAL columns of a configuration table need to be registered
using the pg_extension_config_dump() function if one wants to restore the
properties they had at pg_dump time.

Instead of a single paragraph, perhaps we could make things more
generic like in the attached?

It looks much better, indeed.

Philippe.

--
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs

#4Peter Eisentraut
peter_e@gmx.net
In reply to: Philippe BEAUDOIN (#3)
Re: pg_extension_config_dump() function and sequences

On 01/19/2016 03:14 PM, Philippe BEAUDOIN wrote:

Le 18/01/2016 07:10, Michael Paquier a écrit :

On Wed, Jan 6, 2016 at 5:29 AM, Philippe BEAUDOIN <phb.emaj@free.fr>
wrote:

The pg_extension_config_dump() function can also register sequences,
so that
the current properties of the registered sequences are saved by
pg_dump and
later restored. The function can support sequences either explicitely
created with an ALTER SEQUENCE statement or implicitely created when
a table
contains SERIAL or BIGSERIAL columns. Note that the sequences
associated to
SERIAL or BIGSERIAL columns of a configuration table need to be
registered
using the pg_extension_config_dump() function if one wants to restore
the
properties they had at pg_dump time.

Instead of a single paragraph, perhaps we could make things more
generic like in the attached?

It looks much better, indeed.

committed

--
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs

#5Michael Paquier
michael@paquier.xyz
In reply to: Peter Eisentraut (#4)
Re: pg_extension_config_dump() function and sequences

On Mon, Apr 18, 2016 at 12:17 PM, Peter Eisentraut <peter_e@gmx.net> wrote:

On 01/19/2016 03:14 PM, Philippe BEAUDOIN wrote:

Le 18/01/2016 07:10, Michael Paquier a écrit :

On Wed, Jan 6, 2016 at 5:29 AM, Philippe BEAUDOIN <phb.emaj@free.fr>
wrote:

The pg_extension_config_dump() function can also register sequences,
so that
the current properties of the registered sequences are saved by
pg_dump and
later restored. The function can support sequences either explicitely
created with an ALTER SEQUENCE statement or implicitely created when
a table
contains SERIAL or BIGSERIAL columns. Note that the sequences
associated to
SERIAL or BIGSERIAL columns of a configuration table need to be
registered
using the pg_extension_config_dump() function if one wants to restore
the
properties they had at pg_dump time.

Instead of a single paragraph, perhaps we could make things more
generic like in the attached?

It looks much better, indeed.

committed

Thanks. I completely forgot this patch..
--
Michael

--
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs