Re: A problem about alter table

From: Tomasz Myrta <jasiek(at)klaster(dot)net>
To: jack <datactrl(at)tpg(dot)com(dot)au>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: A problem about alter table
Date: 2003-01-07 13:31:22
Message-ID: 3E1AD6AA.3080406@klaster.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

jack wrote:

> Hi, all
> I'm using postgreSQL 7.2.3. The following statement always cuases a parser
> error, "parse error at or near NOT". Please adivse, thank you in advance.
>
> ALTER TABLE _acct_group1
> ALTER groupkey SET NOT NULL;
>
> Jack
>
From Postgres 7.2 documentation:

"In the current implementation of ADD COLUMN, default and NOT NULL
clauses for the new column are not supported. You can use the SET
DEFAULT form of ALTER TABLE to set the default later. (You may also want
to update the already existing rows to the new default value, using
UPDATE.)"

There is nothing about setting not null fields.
I think you have to create trigger instead of altering table.

Regards,
Tomasz Myrta

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message jack 2003-01-07 14:06:19 Re: A problem about alter table
Previous Message jack 2003-01-07 12:53:06 A problem about alter table