Received: from ext04.sra.co.jp (IDENT:root@ykh28DS17.kng.mesh.ad.jp [133.205.214.17]) by hub.org (8.9.3/8.9.3) with ESMTP id KAA62523 for ; Tue, 31 Aug 1999 10:07:08 -0400 (EDT) (envelope-from t-ishii@ext04.sra.co.jp) Received: from ext04.sra.co.jp (t-ishii@localhost [127.0.0.1]) by ext04.sra.co.jp (8.8.8/8.8.8) with ESMTP id WAA00554; Tue, 31 Aug 1999 22:59:38 +0900 Message-Id: <199908311359.WAA00554@ext04.sra.co.jp> To: Thomas Lockhart cc: robertC@opmr.com, pgsql-interfaces@postgreSQL.org Subject: Re: [INTERFACES] How do I drop a column from a table? From: Tatsuo Ishii Reply-To: t-ishii@sra.co.jp In-reply-to: Your message of Tue, 31 Aug 1999 07:02:01 GMT. <37CB7DE9.D22E7E45@alumni.caltech.edu> Date: Tue, 31 Aug 1999 22:59:38 +0900 Sender: t-ishii@ext04.sra.co.jp > > I'm still quite new at this but it should be a simple operation: How do I > > drop a column form a Postgres table. The next best thing would be knowing > > how to change a column so that it can accept null values. > > Adding columns is directly supported. Removing columns, or redefining > them, is done with a CREATE TABLE AS/DROP TABLE/CREATE TABLE AS/DROP > TABLE sequence, where you write the columns you want to retain into a > temporary table, delete the original table, and then do the same back > into a new table with the same name as the original. But this method might lose some characteristics such as primary key, unique constraints, no? --- Tatsuo Ishii