Re: Add Constraint

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Add Constraint
Дата
Msg-id Pine.BSF.4.10.10010252245190.24391-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на Add Constraint  ("Sivagami ." <sivagami@worlddata.com>)
Список pgsql-sql
On Wed, 25 Oct 2000, Sivagami . wrote:

> Hi all,
> 
> I am a newbie to Postgresql, but I am familiar with SQL. I am trying to add a constraint to my table using the ALTER
TABLEcommand. The command goes like this :
 
> 
> ALTER TABLE USER_SIGNUP ADD CONSTRAINT
> P_USER_SIGNUP_USER_ID PRIMARY KEY(user_id);
> 
> But it is returning the error 
> ERROR:  ALTER TABLE / ADD CONSTRAINT is not implemented 
> 
> Can anyone guide me in the right direction???

We don't have full add constraint support yet.
7.0 allows you to add the subset of foreign keys supported
and current sources should allow check constraints as well.
To get the unique constraint portion, you can add
a unique index on user_id (it's what the system would
have done anyway).  To get the non-null part is a little
harder, you need to find the row in pg_attribute and
set the attnotnull to true, and then make sure there aren't
any null values already in the data set.




В списке pgsql-sql по дате отправления:

Предыдущее
От: Jie Liang
Дата:
Сообщение: Re: How to call a shell command in rule
Следующее
От: Tomas Berndtsson
Дата:
Сообщение: Re: Query Problem