Howto define a constraint in a existing column

From: Intengu Technologies <sindile(dot)bidla(at)gmail(dot)com>
To: pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Howto define a constraint in a existing column
Date: 2009-08-09 09:23:50
Message-ID: a1afa64b0908090223t77d61541pabd18cb5874f04c8@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I am tying to define a primary key constraint to an existing table,
this is what I have tried so far

ALTER TABLE mytable ALTER COLUMN field13 CONSTRAINT name PRIMARY KEY;

I get the following error: ERROR: syntax error at or near "CONSTRAINT"
SQL state: 42601
Character: 61

--
Sindile Bidla

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Thomas Kellerer 2009-08-09 09:32:49 Re: Howto define a constraint in a existing column
Previous Message Andreas Kretschmer 2009-08-09 08:23:56 Re: viewing user defined functions