Skip site navigation (1) Skip section navigation (2)

pg_extension_config_dump() with a sequence

From: Moshe Jacobson <moshe(at)neadwerx(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: pg_extension_config_dump() with a sequence
Date: 2013-08-20 18:24:44
Message-ID: CAJ4CxLk2c8vGdPR2NP9MUQmL0uN9ViHJ_oxzzok+9YMKqtO_Yw@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-general
I wrote an extension and marked one of the tables it creates as a config
table using pg_extension_config_dump(). This caused the data to be dumped
and restored correctly, but the sequence attached to the PK column was not
correctly set to its old value.

In searching for a solution I found an old message where Tom suggested
marking the sequence as a config table in the same way. This seems to work
OK when I use pg_dump, but for some reason, pg_dumpall generates the
following error:

pg_dump: SQL command failed
pg_dump: Error message from server: ERROR:  cannot copy from sequence
"sq_pk_audit_data_type"
pg_dump: The command was: COPY auditlog.sq_pk_audit_data_type  TO stdout;
pg_dumpall: pg_dump failed on database "ises", exiting


Why does it work with pg_dump but not pg_dumpall?

-- 
Moshe Jacobson
Nead Werx, Inc. | Manager of Systems Engineering
2323 Cumberland Parkway, Suite 201 | Atlanta, GA 30339
moshe(at)neadwerx(dot)com | www.neadwerx.com

"Quality is not an act, it is a habit." -- Aristotle

Responses

pgsql-general by date

Next:From: Olivier ChaussavoineDate: 2013-08-20 18:38:51
Subject: Re: earthdistance
Previous:From: Pavel StehuleDate: 2013-08-20 17:53:29
Subject: Re: Memory Issue with array_agg?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group