Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 111F8B37936 for ; Sun, 10 Jun 2012 07:31:07 -0300 (ADT) Received: from smtp6-g21.free.fr ([2a01:e0c:1:1599::15]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SdfQF-00087z-Bc for pgsql-bugs@postgresql.org; Sun, 10 Jun 2012 10:31:06 +0000 Received: from [192.168.1.2] (unknown [82.233.212.24]) by smtp6-g21.free.fr (Postfix) with ESMTP id 0F961822A1; Sun, 10 Jun 2012 12:30:45 +0200 (CEST) Message-ID: <4FD47754.8040301@free.fr> Date: Sun, 10 Jun 2012 12:30:44 +0200 From: Philippe BEAUDOIN User-Agent: Thunderbird 2.0.0.24 (X11/20101027) MIME-Version: 1.0 To: Tom Lane CC: pgsql-bugs@postgresql.org Subject: [Fwd: Re: BUG #6682: pg_dump and sequence values of serial columns for extension configuration tables] Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201206/93 X-Sequence-Number: 33320 Sorry Tom, I forgot to include pgsql-bugs in the email list... Hi Tom, Thanks for your answer. Tom Lane a =E9crit : > phb.emaj@free.fr writes: > =20 >> When a table is registered as an extension configuration table and con= tains >> a serial column, the current value of the sequence associated to this = serial >> column is not dumped by pg_dump. >> =20 > > 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. > =20 OK, there may be cases when one doesn't want to restore the associated=20 sequence value. In such a case: - either a function allows to register the serial sequence as a=20 configuration table (your proposal), - or the serial sequence is implicitely considered as a configuration=20 table, which would me more natural (see discussion for BUG #6683), and=20 another function allows to removes this state. Anyway, (and this is not strictly related to this bug report) there is a=20 need: - for registering an independant sequence of an extension as "to be=20 pg_dumped/restored", and - for unregistering a table and sequence that has been previously=20 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','');" >> =20 > > This test proves nothing of the kind. Please read the error message: > ERROR: pg_extension_config_dump() can only be called from an SQL scrip= t executed by CREATE EXTENSION > You have to do it in the extension's script. > =20 You are right. My intent here was just to show that feeding the=20 pg_extension_config_dump function with the sequence name is not a=20 solution, ... in the current version at least. Regards. Philippe BEAUDOIN.