Re: Syntax of: alter table ... add constraint ... - Mailing list pgsql-general

From Alban Hertroys
Subject Re: Syntax of: alter table ... add constraint ...
Date
Msg-id 914F325A-FC52-4C5F-8E2A-0C4816ABDD56@solfertje.student.utwente.nl
Whole thread Raw
In response to Re: Syntax of: alter table ... add constraint ...  (Alexander Farber <alexander.farber@gmail.com>)
Responses Re: Syntax of: alter table ... add constraint ...  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On 8 Nov 2010, at 16:18, Alexander Farber wrote:

> Thank you,
>
> alter table pref_users add constraint pref_users_medals_check check
> (medals >= 0);
>
> has worked!


To clarify a bit on this; if you add a constraint, you specify its name and what type of constraint it is, before
specifyingthe actual constraint expression. 
Hence the need to add 'check' (the constraint type) between 'pref_users_medals_check' (the name) and '(medals >= 0)'
(theexpression). 

Alban Hertroys

--
If you can't see the forest for the trees,
cut the trees and you'll see there is no forest.


!DSPAM:737,4cd82a7b10261263518415!



pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: postgresql scalability issue
Next
From: John R Pierce
Date:
Subject: Re: postgresql scalability issue