pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedSET DEFAULT
2+ messages / 2 participants
[nested] [flat]
* SET DEFAULT
@ 2002-11-13 12:19 Archibald Zimonyi <archie@netg.se>
2002-11-13 12:38 ` Re: SET DEFAULT Achilleus Mantzios <achill@matrix.gatewaynet.com>
0 siblings, 1 reply; 2+ messages in thread
From: Archibald Zimonyi @ 2002-11-13 12:19 UTC (permalink / raw)
To: 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
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: SET DEFAULT
2002-11-13 12:19 SET DEFAULT Archibald Zimonyi <archie@netg.se>
@ 2002-11-13 12:38 ` Achilleus Mantzios <achill@matrix.gatewaynet.com>
0 siblings, 0 replies; 2+ messages in thread
From: Achilleus Mantzios @ 2002-11-13 12:38 UTC (permalink / raw)
To: Archibald Zimonyi <archie@netg.se>; +Cc: pgsql-sql
On Wed, 13 Nov 2002, Archibald Zimonyi wrote:
>
> 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;
ALTER TABLE decks alter column modified SET 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
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
>
==================================================================
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@matrix.gatewaynet.com
mantzios@softlab.ece.ntua.gr
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2002-11-13 12:38 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-11-13 12:19 SET DEFAULT Archibald Zimonyi <archie@netg.se>
2002-11-13 12:38 ` Achilleus Mantzios <achill@matrix.gatewaynet.com>
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