pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Achilleus Mantzios <achill@matrix.gatewaynet.com>
To: Robert Urban <urban@UNIX-Beratung.de>
Cc: pgsql-sql@postgresql.org
Subject: Re: removing "not null" modifier
Date: Mon, 13 Mar 2006 17:04:03 +0200 (EET)
Message-ID: <Pine.LNX.4.44.0603131703440.12396-100000@matrix.gatewaynet.com> (raw)
In-Reply-To: <200603131307.k2DD73BB020477@noisy.spielwiese.de>

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




view thread (3+ messages)  latest in thread

Message-ID: <Pine.LNX.4.44.0603131703440.12396-100000@matrix.gatewaynet.com>
Permalink:  ../Pine.LNX.4.44.0603131703440.12396-100000@matrix.gatewaynet.com/
Also on:    postgresql.org/message-id/Pine.LNX.4.44.0603131703440.12396-100000@matrix.gatewaynet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: achill@matrix.gatewaynet.com, urban@UNIX-Beratung.de
  Subject: Re: removing "not null" modifier
  In-Reply-To: <Pine.LNX.4.44.0603131703440.12396-100000@matrix.gatewaynet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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