Received: from localhost (IDENT:root@hectic-1.jpl.nasa.gov [128.149.68.203]) by hub.org (8.9.3/8.9.3) with ESMTP id DAA00855 for ; Tue, 31 Aug 1999 03:02:32 -0400 (EDT) (envelope-from lockhart@alumni.caltech.edu) Received: from alumni.caltech.edu (lockhart@localhost [127.0.0.1]) by localhost (8.8.7/8.8.7) with ESMTP id HAA14083; Tue, 31 Aug 1999 07:02:01 GMT Sender: lockhart@hub.org Message-ID: <37CB7DE9.D22E7E45@alumni.caltech.edu> Date: Tue, 31 Aug 1999 07:02:01 +0000 From: Thomas Lockhart X-Mailer: Mozilla 4.6 [en] (X11; I; Linux 2.0.36 i686) X-Accept-Language: en MIME-Version: 1.0 To: robertC@opmr.com CC: pgsql-interfaces@postgresql.org Subject: Re: [INTERFACES] How do I drop a column from a table? References: <91E49E736688D21185F500A0C985C705156C6C@DOOM> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit > 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. Good luck. - Thomas -- Thomas Lockhart lockhart@alumni.caltech.edu South Pasadena, California