am  Thu, dem 12.10.2006, um 15:27:08 -0400 mailte Jonathan Vanasco folgendes:
> 
> I got a really bad error message in postgres on a CREATE TABLE in 8.1.0:
> 
>       ERROR:  column "id" referenced in foreign key constraint does not 
>       exist
> 
> That seems odd-- I mean, I know I obviously made an error.  I'm just  
> used to more detailed errors.

Can you show us your SQL? The message is clear: you create a new table
with a foreign key to an other table that doesn't exist. An example:

-- first, i create a table with a primary key
test=# create table t1 (id int primary key, foo text);
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "t1_pkey" for 
table "t1"
CREATE TABLE
-- now i create a new table with a foreign key constraint to the first
-- table
test=# create table t2 (id int references t1(id));
CREATE TABLE
--
-- and now i make a mistake
--
test=# create table t3 (id int references t1(id_));
ERROR:  column "id_" referenced in foreign key constraint does not exist



HTH, Andreas
-- 
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47215,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Reply via email to