From: Philippe BEAUDOIN <phb.emaj@free.fr>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@postgresql.org
Subject: [Fwd: Re: BUG #6682: pg_dump and sequence values of serial columns for extension configuration tables]
Date: Sun, 10 Jun 2012 12:30:44 +0200
Message-ID: <4FD47754.8040301@free.fr> (raw)
Sorry Tom, I forgot to include pgsql-bugs in the email list...
Hi Tom,
Thanks for your answer.
Tom Lane a écrit :
> phb.emaj@free.fr writes:
>
>> When a table is registered as an extension configuration table and contains
>> a serial column, the current value of the sequence associated to this serial
>> column is not dumped by pg_dump.
>>
>
> I think the way to make that happen is to also register the sequence as
> a configuration table of the extension. It's not clear to me that that
> should happen by default; it would depend a lot on how the extension
> designer intends to manage modifications of the table.
>
OK, there may be cases when one doesn't want to restore the associated
sequence value.
In such a case:
- either a function allows to register the serial sequence as a
configuration table (your proposal),
- or the serial sequence is implicitely considered as a configuration
table, which would me more natural (see discussion for BUG #6683), and
another function allows to removes this state.
Anyway, (and this is not strictly related to this bug report) there is a
need:
- for registering an independant sequence of an extension as "to be
pg_dumped/restored", and
- for unregistering a table and sequence that has been previously
processed by pg_extension_config_dump (unless I miss the way to do this).
>> echo "--> And sequences cannot be registered as 'content to be dumped'"
>> $PGBIN/psql -ac "select
>> pg_catalog.pg_extension_config_dump('tbl1_col1_seq','');"
>>
>
> This test proves nothing of the kind. Please read the error message:
> ERROR: pg_extension_config_dump() can only be called from an SQL script executed by CREATE EXTENSION
> You have to do it in the extension's script.
>
You are right. My intent here was just to show that feeding the
pg_extension_config_dump function with the sequence name is not a
solution, ... in the current version at least.
Regards.
Philippe BEAUDOIN.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: phb.emaj@free.fr, tgl@sss.pgh.pa.us
Subject: Re: [Fwd: Re: BUG #6682: pg_dump and sequence values of serial columns for extension configuration tables]
In-Reply-To: <4FD47754.8040301@free.fr>
References: <4FD47754.8040301@free.fr>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox