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

pg_dump trouble

From: gauthier lawny <gauthier_lawny(at)yahoo(dot)fr>
To: pgsql-admin(at)postgresql(dot)org
Subject: pg_dump trouble
Date: 2004-09-24 12:33:59
Message-ID: (view raw or whole thread)
Lists: pgsql-admin
Here is the trouble I encountered.

I got 2 tables like
create table mytable(idnop serial, other varchar,
primary key (idnop));
create table reftable(idnop integer references
mytable, primary key (idnop));

pgsql create implicitly a sequence to handle the idnop
I perfomed some insertions into the 2 tables, no
Afterthat I run pg_dump with -D option (insert into
(colomn, ...) values (...);
The trouble is when it dumps the sequence. Instead of
dumping the current value (which is the last used for
an insertion into mytable) it dumps the value 1.
Obviously when I restore the data and I try to perform
an other insertion into mytable it fails because of
the  primary key violation.

The presence of -D option doesn't have any effect on
the result.


Vous manquez d’espace pour stocker vos mails ? 
Yahoo! Mail vous offre GRATUITEMENT 100 Mo !
Créez votre Yahoo! Mail sur

Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les nouveautés pour dialoguer instantanément avec vos amis. A télécharger gratuitement sur


pgsql-admin by date

Next:From: Manolatos TilemahosDate: 2004-09-24 12:47:09
Subject: How to pass initdb LC_COLLATE & locale parameters when using windows? (with or without pginstaller)
Previous:From: Iulia PacurarDate: 2004-09-24 06:36:43
Subject: log file for pg_autovacuum

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