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

From Raymond O'Donnell
Subject Re: Syntax of: alter table ... add constraint ...
Date
Msg-id 4CD813A3.4000709@iol.ie
Whole thread Raw
In response to Syntax of: alter table ... add constraint ...  (Alexander Farber <alexander.farber@gmail.com>)
Responses Re: Syntax of: alter table ... add constraint ...
List pgsql-general
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@iol.ie

pgsql-general by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: Syntax of: alter table ... add constraint ...
Next
From: Alexander Farber
Date:
Subject: Re: Syntax of: alter table ... add constraint ...