Tuesday, June 17, 2008

[pgsql-de-allgemein] Spalte mit not null und deferrable hinzufügen

Hallo,

ich möchte eine Spalte mit einem initially deferred not null constraint
hinzufügen.

db=# alter table mytable add column "time" timestamp with time zone not
null deferrable initially deferred;
FEHLER: falsch platzierte DEFERRABLE-Klausel

Laut Doku müsste der Befehl eigentlich funktionieren:

alter table Doku

ADD [ COLUMN ] /column/ /type/ [ /column_constraint/ [ ... ] ]

create table Doku:

where /column_constraint/ is:

[ CONSTRAINT /constraint_name/ ]
{ NOT NULL |
NULL |
UNIQUE /index_parameters/ |
PRIMARY KEY /index_parameters/ |
CHECK ( /expression/ ) |
REFERENCES /reftable/ [ ( /refcolumn/ ) ] [ MATCH FULL | MATCH PARTIAL | MATCH SIMPLE ]
[ ON DELETE /action/ ] [ ON UPDATE /action/ ] }
[ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ]

select version();

version
--------------------------------------------------------------------------------------------
PostgreSQL 8.2.6 on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC)
4.2.1 (SUSE Linux)

Hat jemand Hinweise?

Thomas

--
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de


--
Sent via pgsql-de-allgemein mailing list (pgsql-de-allgemein@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-de-allgemein

No comments: