Re: A problem about alter table

From: Achilleus Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>
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 18:41:49
Message-ID: Pine.LNX.4.44.0301071640430.8183-100000@matrix.gatewaynet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Wed, 8 Jan 2003, jack wrote:

> But on postgreSQL 7.2 reference manual, there is a statement for alter table
> such as, ALTER TABLE [ ONLY ] table [ * ]
> ALTER [ COLUMN ] column { SET | DROP } NOT NULL
>
> Do you mean this one hasn't been implemented?
>
> Jack

This syntax is valid in 7.3 (not 7.2)

>
> ----- Original Message -----
> From: "Tomasz Myrta" <jasiek(at)klaster(dot)net>
> To: "jack" <datactrl(at)tpg(dot)com(dot)au>
> Cc: <pgsql-sql(at)postgresql(dot)org>
> Sent: Tuesday, January 07, 2003 11:31 PM
> Subject: Re: [SQL] A problem about alter table
>
>
> > 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
> >
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>

==================================================================
Achilleus Mantzios
S/W Engineer
IT dept
Dynacom Tankers Mngmt
Nikis 4, Glyfada
Athens 16610
Greece
tel: +30-10-8981112
fax: +30-10-8981877
email: achill(at)matrix(dot)gatewaynet(dot)com
mantzios(at)softlab(dot)ece(dot)ntua(dot)gr

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Rod Taylor 2003-01-07 18:45:14 Re: [SQL] 7.3.1 index use / performance
Previous Message Tom Lane 2003-01-07 18:39:57 Re: [SQL] [PERFORM] 7.3.1 index use / performance