pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomasz Myrta <jasiek@klaster.net>
To: jack <datactrl@tpg.com.au>
Cc: pgsql-sql@postgresql.org
Subject: Re: A problem about alter table
Date: Tue, 07 Jan 2003 14:31:22 +0100
Message-ID: <3E1AD6AA.3080406@klaster.net> (raw)
In-Reply-To: <001601c2b64b$ba8c3b30$1400a8c0@jac>
References: <001601c2b64b$ba8c3b30$1400a8c0@jac>

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




view thread (6+ messages)  latest in thread

Message-ID: <3E1AD6AA.3080406@klaster.net>
Permalink:  ../3E1AD6AA.3080406@klaster.net/
Also on:    postgresql.org/message-id/3E1AD6AA.3080406@klaster.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: jasiek@klaster.net, datactrl@tpg.com.au
  Subject: Re: A problem about alter table
  In-Reply-To: <3E1AD6AA.3080406@klaster.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox