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

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: Alexander Farber <alexander(dot)farber(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Syntax of: alter table ... add constraint ...
Date: 2010-11-08 15:13:39
Message-ID: 4CD813A3.4000709@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)iol(dot)ie

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alexander Farber 2010-11-08 15:18:59 Re: Syntax of: alter table ... add constraint ...
Previous Message Thomas Kellerer 2010-11-08 15:10:18 Re: Syntax of: alter table ... add constraint ...