Search Postgresql Archives

Re: Syntax of: alter table ... add constraint ...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 specifying the actual constraint expression.
Hence the need to add 'check' (the constraint type) between 'pref_users_medals_check' (the name) and '(medals >= 0)' (the expression).

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!



-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux