X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 286CF9DC813 for ; Mon, 13 Mar 2006 09:58:31 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 50453-09 for ; Mon, 13 Mar 2006 09:58:34 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from matrix.gatewaynet.com (host2.dynacom.ondsl.gr [62.103.35.210]) by postgresql.org (Postfix) with ESMTP id 63DEE9DCC41 for ; Mon, 13 Mar 2006 09:58:27 -0400 (AST) Received: from matrix.gatewaynet.com (localhost.localdomain [127.0.0.1]) by matrix.gatewaynet.com (8.12.8/8.12.8) with ESMTP id k2DF43Op012423; Mon, 13 Mar 2006 17:04:03 +0200 Received: from localhost (achill@localhost) by matrix.gatewaynet.com (8.12.8/8.12.8/Submit) with ESMTP id k2DF43rq012419; Mon, 13 Mar 2006 17:04:03 +0200 Date: Mon, 13 Mar 2006 17:04:03 +0200 (EET) From: Achilleus Mantzios To: Robert Urban cc: pgsql-sql@postgresql.org Subject: Re: removing "not null" modifier In-Reply-To: <200603131307.k2DD73BB020477@noisy.spielwiese.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-7 Content-Transfer-Encoding: 8BIT X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.111 required=5 tests=[AWL=0.111, UPPERCASE_25_50=0] X-Spam-Score: 0.111 X-Spam-Level: X-Archive-Number: 200603/186 X-Sequence-Number: 24532 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