Skip site navigation (1) Skip section navigation (2)

Spalte mit not null und deferrable hinzufügen

From: Thomas Guettler <hv(at)tbz-pariv(dot)de>
To: pgsql-de-allgemein(at)postgresql(dot)org
Subject: Spalte mit not null und deferrable hinzufügen
Date: 2008-06-17 09:36:26
Message-ID: 4857859A.7080808@tbz-pariv.de (view raw or flat)
Thread:
Lists: pgsql-de-allgemein
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


Responses

pgsql-de-allgemein by date

Next:From: A. KretschmerDate: 2008-06-17 10:00:28
Subject: Re: Sp?==?iso-8859-1?Q?alte mit not null und deferrable hinzufügen
Previous:From: Susanne EbrechtDate: 2008-06-16 15:03:38
Subject: PostgreSQL auf der FrOSCon

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group