Possible problem with type bigserial in pg_dump/pg_restore - Mailing list pgsql-bugs

From Marcio A. Sepp
Subject Possible problem with type bigserial in pg_dump/pg_restore
Date
Msg-id 200702071451.l17EpRvg008883@josephine.concordia.psi.br
Whole thread Raw
Responses Re: Possible problem with type bigserial in pg_dump/pg_restore  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs

It seems to have a problem when making backup and restore with type bigserial. I perceived when was restoring a database and the sequence created for field bigserial was not correctly restored.

For example, i've created the follow structure:

CREATE TABLE cager.princ
(
  cd_princ bigserial NOT NULL,
  nm_princ character varying(50),
  CONSTRAINT "pk-princ-cd_princ" PRIMARY KEY (cd_princ)
)
WITHOUT OIDS;

Making backup with:
C:\Arquivos de programas\pgAdmin III\1.6\pg_dump.exe -i -h 192.168.7.1 -p 5432 -U postgres -F c -b -v -f "C:\Temp\testepad.backup" testepad

Making restore with:
C:\Arquivos de programas\pgAdmin III\1.6\pg_restore.exe -i -h 192.168.7.1 -p 5432 -U postgres -d test1 -v "C:\Temp\testepad.backup"

The same table now is:

CREATE TABLE cager.princ
(
  cd_princ bigint NOT NULL DEFAULT nextval('princ_cd_princ_seq'::regclass),
  nm_princ character varying(50),
  CONSTRAINT "pk-princ-cd_princ" PRIMARY KEY (cd_princ)
)
WITHOUT OIDS;

Take a look at the field cd_princ. Next value should be 'cager.princ_cd_princ_seq'.

I've tested it with pg_admin version 1.6.2 and 1.4.3.

If need more information, please, contact me.

Follow in annex messages on restoring.

<<...>>

Att.
Márcio A. Sepp
ZYON TECNOLOGIA LTDA
55 (49) 3444-4591
55 (49) 8405-9215

Attachment

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: server crash: displaying sqlerrm in exception block
Next
From: "Michal Schwarz"
Date:
Subject: BUG #2974: broken CHECK constraint with varchar