pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Dado Feigenblatt <dado@wildbrain.com>
To: pgsql-sql <pgsql-sql@postgresql.org>
Subject: Re: ERROR: UNIQUE constraint matching given keys for referenced table "sequences" not found
Date: Tue, 17 Jul 2001 09:37:07 +0100
Message-ID: <005901c10e9b$ab5cf400$1001a8c0@archonet.com> (raw)
References: <3B53A705.4060807@wildbrain.com>

From: "Dado Feigenblatt" <dado@wildbrain.com>

> 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




view thread (2+ messages)

Message-ID: <005901c10e9b$ab5cf400$1001a8c0@archonet.com>
Permalink:  ../005901c10e9b$ab5cf400$1001a8c0@archonet.com/
Also on:    postgresql.org/message-id/005901c10e9b$ab5cf400$1001a8c0@archonet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: dev@archonet.com, dado@wildbrain.com
  Subject: Re: ERROR: UNIQUE constraint matching given keys for referenced table "sequences" not found
  In-Reply-To: <005901c10e9b$ab5cf400$1001a8c0@archonet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox