Search Postgresql Archives

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

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

 



On 08/11/2010 14:50, Alexander Farber wrote:

alter table pref_users add constraint pref_users_medals_check (medals>= 0);
ERROR:  syntax error at or near "("
LINE 1: ...pref_users add constraint pref_users_medals_check (medals>=...
                                                              ^
and many combinations of quotes and "check" inbetween,
but can't find the correct syntax

Working from memory, I think you need the word "check" before the opening parenthesis.

Do you use PgAdmin? - You can go through the motions of creating the constraint there, and see what SQL it generates.

Ray.


--
Raymond O'Donnell :: Galway :: Ireland
rod@xxxxxx

--
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