SET DEFAULT - Mailing list pgsql-sql

From Archibald Zimonyi
Subject SET DEFAULT
Date
Msg-id Pine.LNX.4.44.0211131316480.15540-100000@elvegris.netg.se
Whole thread Raw
In response to Re: Permission on insert rules  (Luis Sousa <llsousa@ualg.pt>)
Responses Re: SET DEFAULT  (Achilleus Mantzios <achill@matrix.gatewaynet.com>)
List pgsql-sql
Hi everyone,

I have a problem with adding a column to an existing table. I want to add
a column named modified which is of datatype TIMESTAMP and has a DEFAULT
CURRENT_TIMESTAMP as it's initial value. I cannot do this with ALTER
TABLE, it tells me to user ALTER TABLE SET DEFAULT instead but I cannot
figure out the syntax with the help of the manuals.

My ALTER TABLE looked like this:

alter table decks add column modified timestamp default current_timestamp;

and the error I get is this:

ERROR:  Adding columns with defaults is not implemented.       Add the column, then use ALTER TABLE SET DEFAULT.

Thanks in advance,

Archie



pgsql-sql by date:

Previous
From: Christoph Haller
Date:
Subject: Re: Passing OLD/NEW as composite type PL/PGSQL
Next
From: Achilleus Mantzios
Date:
Subject: Re: SET DEFAULT