Received: from dns2.e-scape.net ([216.13.52.3]) by hub.org (8.9.3/8.9.3) with ESMTP id KAA69658 for ; Tue, 31 Aug 1999 10:44:10 -0400 (EDT) (envelope-from robertC@opmr.com) Received: from optimal-robotics.com (optimal.e-scape.net [216.13.51.254]) by dns2.e-scape.net (8.8.8/8.8.8) with ESMTP id KAA03538 for ; Tue, 31 Aug 1999 10:44:58 -0400 (EDT) Received: from doom.optimal-robotics.com [10.10.10.1] by optimal-robotics.com [10.10.10.242] with SMTP (MDaemon.v2.83t.R) for ; Tue, 31 Aug 1999 10:42:16 -0400 Received: by DOOM with Internet Mail Service (5.5.2448.0) id ; Tue, 31 Aug 1999 10:34:48 -0400 Message-ID: <91E49E736688D21185F500A0C985C705156D9D@DOOM> From: Robert Carbonari To: pgsql-interfaces@postgresql.org Subject: Re: [INTERFACES] How do I drop a column from a table? Date: Tue, 31 Aug 1999 10:34:47 -0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2448.0) Content-Type: text/plain X-MDaemon-Deliver-To: pgsql-interfaces@postgresql.org X-Return-Path: robertC@opmr.com Reply-To: robertC@opmr.com > Hi, > > 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. > > Any takers? Hi Robert, I don't know how to email all in elm, so if you could forward this to the list for verification I would appreciate. Anyway, I don't think you can drop a column. What you can do is create a new table by doing a select into the new table (leaving out the columns you don't want) and then droping the old table. Once the old table is dropped you can rename the new to the old one's name: select f1,f2...,fn into table newtable from oldtable; drop table oldtable; alter table newtable rename to oldtable; Hope this helps...james > ************ > Robert Carbonari Programmer Optimal Robotics Corp. e-mail: robertc@optimal-robotics.com phone: (514)738-8885 ext. 146