Re: pg_dump fails to include sequences, leads to restore fail in any version
От | Jeffrey Baker |
---|---|
Тема | Re: pg_dump fails to include sequences, leads to restore fail in any version |
Дата | |
Msg-id | fd145f7d0806171451l5f602b70la8986a4e6a1d690c@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: pg_dump fails to include sequences, leads to restore fail in any version (Alvaro Herrera <alvherre@commandprompt.com>) |
Ответы |
Re: pg_dump fails to include sequences, leads to restore
fail in any version
|
Список | pgsql-hackers |
On Tue, Jun 17, 2008 at 2:43 PM, Alvaro Herrera <alvherre@commandprompt.com> wrote:
[snip]
The table was originally created this way:
CREATE TABLE transaction
(
transaction_id SERIAL PRIMARY KEY,
buyer_account_id INTEGER,
seller_account_id INTEGER,
date DATE,
item_id INTEGER,
source TEXT
);
However, when dumped with pg_dump 8.1, it comes out this way:
CREATE TABLE "transaction" (
transaction_id integer DEFAULT nextval('transaction_transaction_id_seq'::regclass) NOT NULL,
buyer_account_id integer,
seller_account_id integer,
date date,
item_id integer,
source text
);
.. and the sequence does not get dumped with it.
-jwb
Jeffrey Baker escribió:> On Tue, Jun 17, 2008 at 10:59 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:How did you set it up exactly? I have no problem with this situation:
>
> > "Jeffrey Baker" <jwbaker@gmail.com> writes:
> > > It is impossible to dump (with pg_dump -Ocx) and restore (with psql) a
> > > database which contains sequences in any of 8.1, 8.2, or 8.3:
> >
> > I should think we would have heard about it before now if such a
> > sweeping claim were true.
>
> Last time this problem came up, in August, you dismissed it somewhat
> rudely. So perhaps the lack of reports is due more to perception than any
> other thing.
[snip]
The table was originally created this way:
CREATE TABLE transaction
(
transaction_id SERIAL PRIMARY KEY,
buyer_account_id INTEGER,
seller_account_id INTEGER,
date DATE,
item_id INTEGER,
source TEXT
);
However, when dumped with pg_dump 8.1, it comes out this way:
CREATE TABLE "transaction" (
transaction_id integer DEFAULT nextval('transaction_transaction_id_seq'::regclass) NOT NULL,
buyer_account_id integer,
seller_account_id integer,
date date,
item_id integer,
source text
);
.. and the sequence does not get dumped with it.
-jwb
В списке pgsql-hackers по дате отправления: