Received: from anchor-post-30.mail.demon.net (anchor-post-30.mail.demon.net [194.217.242.88]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f6H93Ra26593 for ; Tue, 17 Jul 2001 05:03:28 -0400 (EDT) (envelope-from dev@archonet.com) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-30.mail.demon.net with esmtp (Exim 2.12 #1) id 15MQlE-000HZh-0U; Tue, 17 Jul 2001 10:03:20 +0100 Received: from client (client.archonet.com [192.168.1.16]) by mainbox.archonet.com (Postfix) with SMTP id 4B3CA128EB; Tue, 17 Jul 2001 09:37:11 +0100 (BST) Message-ID: <005901c10e9b$ab5cf400$1001a8c0@archonet.com> From: "Richard Huxton" To: "Dado Feigenblatt" , "pgsql-sql" References: <3B53A705.4060807@wildbrain.com> Subject: Re: ERROR: UNIQUE constraint matching given keys for referenced table "sequences" not found Date: Tue, 17 Jul 2001 09:37:07 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Archive-Number: 200107/209 X-Sequence-Number: 4005 From: "Dado Feigenblatt" > I'm trying to create some tables with foreign keys. > When I try to create a foreign key ... > > foreign key(seq_code) references sequences(seq_code) on update > CASCADE on delete CASCADE, > > I get this message: > > ERROR: UNIQUE constraint matching given keys for referenced table > "sequences" not found > > The problem is that the referenced field and table exist. > Any hint? Do you have a unique index on sequences.seq_code? - Richard Huxton