From: | Achilleus Mantzios <achill(at)matrix(dot)gatewaynet(dot)com> |
---|---|
To: | Robert Urban <urban(at)UNIX-Beratung(dot)de> |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: removing "not null" modifier |
Date: | 2006-03-13 15:04:03 |
Message-ID: | Pine.LNX.4.44.0603131703440.12396-100000@matrix.gatewaynet.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
O Robert Urban έγραψε στις Mar 13, 2006 :
> Hello,
>
> let's say I have created a postgresql-7.2.2 db using the following cmds:
>
> CREATE TABLE status
> (
> id SERIAL NOT NULL PRIMARY KEY,
> name VARCHAR(32)
> );
>
> CREATE TABLE event
> (
> id SERIAL NOT NULL PRIMARY KEY,
> description VARCHAR(32),
> status_id INTEGER NOT NULL REFERENCES status(id)
> );
>
> in psql I then see:
>
> mydb=# \d event
> Table "event"
> Column | Type | Modifiers
> -------------+-----------------------+--------------------------------------------------
> id | integer | not null default nextval('"event_id_seq"'::text)
> description | character varying(32) |
> status_id | integer | not null
> Primary key: event_pkey
> Triggers: RI_ConstraintTrigger_43210
>
>
> The question:
>
> how can I get rid of the "not null" modifier on status_id?
ALTER TABLE event ALTER status_id DROP NOT NULL;
>
> thanks,
>
> Robert Urban
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>
--
-Achilleus
From | Date | Subject | |
---|---|---|---|
Next Message | Rod Taylor | 2006-03-13 15:10:51 | Re: Permission to Select |
Previous Message | Tom Lane | 2006-03-13 14:57:39 | Re: Set generating functions and subqueries |