X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id C8BD59FB4DF for ; Fri, 1 Sep 2006 12:37:34 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 99620-01-5 for ; Fri, 1 Sep 2006 12:37:14 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id C4EF39FB556 for ; Fri, 1 Sep 2006 11:40:31 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from smtp3.ualg.pt (smtp3.ualg.pt [193.136.224.6]) by svr4.postgresql.org (Postfix) with ESMTP id 5557E5AF028 for ; Fri, 1 Sep 2006 14:40:29 +0000 (GMT) Received: by smtp3.ualg.pt (Postfix, from userid 501) id 1DD511E005A; Fri, 1 Sep 2006 15:40:25 +0100 (WEST) Received: from localhost (smtp3.ualg.pt [127.0.0.1]) by smtp3.ualg.pt (Postfix) with ESMTP id F27401E0050 for ; Fri, 1 Sep 2006 15:40:24 +0100 (WEST) X-Virus-Scanned: amavisd-new at ualg.pt Received: from smtp3.ualg.pt ([127.0.0.1]) by localhost (smtp3.ualg.pt [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6L8D+-PzI7MI for ; Fri, 1 Sep 2006 15:40:24 +0100 (WEST) Received: from [10.17.20.14] (unknown [10.17.20.14]) by smtp3.ualg.pt (Postfix) with ESMTP id 0D0681E003B for ; Fri, 1 Sep 2006 15:40:24 +0100 (WEST) Message-ID: <44F84649.9050502@ualg.pt> Date: Fri, 01 Sep 2006 15:40:09 +0100 From: =?ISO-8859-1?Q?Lu=EDs_Sousa?= User-Agent: Debian Thunderbird 1.0.2 (X11/20060804) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-admin Subject: Problem using pg_restore with -a option Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.384 tagged_above=0 required=5 tests=SPF_SOFTFAIL X-Spam-Level: * X-Archive-Number: 200609/4 X-Sequence-Number: 22918 Hi all, I'm using PostgreSQL 7.4.7-6sarge2 (debian) Using the schema below, doing a pg_dump -Fc, delete all data, and a pg_restore -a, the sequence of inserting data isn't correct issuing an error. Could this be a bug? Notice that on schema, table periodo depends on tipo, but the sequence is table periodo, then table tipo and after table periodo is changed to reference tipo. My schema file: drop table periodo cascade ; drop table tipo cascade ; create table periodo ( "idPeriodo" serial not null, "idTipo" int4, designacao varchar(50), constraint pk_Periodo primary key ("idPeriodo") ) ; create table tipo ( "idTipo" serial not null, tipo varchar(5), designacao varchar(50), constraint pk_Tipo primary key ("idTipo") ) ; alter table periodo add constraint fk_tipo foreign key ("idTipo") references tipo ("idTipo") ; My data on tables: INSERT INTO tipo (tipo,designacao) VALUES ('T','Type'); INSERT INTO periodo ("idTipo",designacao) VALUES (1,'periodo'); Error: pg_restore: ERROR: insert or update on table "periodo" violates foreign key constraint "fk_tipo" DETAIL: Key (idTipo)=(1) is not present in table "tipo". Best regards, Luís Sousa