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

Re: references again

From: Michael Glaesemann <grzm(at)myrealbox(dot)com>
To: "D(dot)C(dot)" <coughlandesmond(at)yahoo(dot)fr>
Cc: PostgreSQL Novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: references again
Date: 2005-05-22 08:31:54
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
On May 22, 2005, at 4:53 PM, D.C. wrote:

> NOTICE:  CREATE TABLE will create implicit sequence
> "ventes_ventes_id_seq" for serial column "ventes.ventes_id"
> NOTICE:  CREATE TABLE will create implicit sequence
> "ventes_ventes_stock_id_seq" for serial column  
> "ventes.ventes_stock_id"
> NOTICE:  adding missing FROM-clause entry for table "stock"
> ERROR:  only table "ventes" can be referenced in check constraint

As the error states, CHECK constraints currently only permit  
comparisons within the same table. To compare values across tables,  
such as you are looking to do, you need to use a trigger that will  
raise an error if the conditions you desire are not met.

Check out the CREATE TRIGGER documentation in the SQL command  
reference in the PostgreSQL docs. You're probably interested in  


Hope this helps.

Michael Glaesemann
grzm myrealbox com

PS. Regarding your earlier question regarding your email address  
showing up in your newreader, I don't think there's a whole lot that  
can be done about that, though I wouldn't mind being proven wrong.  
You can take some comfort in knowing that email addresses are  
obscured in the mailing list archives.

In response to

pgsql-novice by date

Next:From: Ramon OrticioDate: 2005-05-23 01:37:27
Subject: postgres file
Previous:From: D.C.Date: 2005-05-22 07:53:05
Subject: references again

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