Received: from parmastocks2.cylink.com.cy (parmastocks2.cylink.com.cy [194.42.142.6]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f778ED652705 for ; Tue, 7 Aug 2001 04:14:15 -0400 (EDT) (envelope-from grigoriy.vovk@linustech.com.cy) Received: from callisto.internal.linustech.com.cy (parmastocks.cylink.com.cy [194.42.135.92]) by parmastocks2.cylink.com.cy (Postfix) with ESMTP id 776F03408F; Tue, 7 Aug 2001 11:10:46 +0300 (EEST) Date: Tue, 7 Aug 2001 11:13:55 +0300 (EEST) From: "Grigoriy G. Vovk" X-X-Sender: To: Robby Slaughter Cc: Suhadi , SQL Subject: RE: Delete coloumn In-Reply-To: Message-ID: <20010807110112.R931-100000@callisto.internal.linustech.com.cy> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200108/90 X-Sequence-Number: 4311 Aug 6, 23:35 -0500, Robby Slaughter wrote: > SELECT INTO it. Example: > > CREATE TABLE sample ( > id INTEGER, > data TEXT, > badcolumn DATE ); > > Now to delete the bad column table: > > CREATE TABLE sample_copy ( > id INTEGER, > data TEXT); > > and then copy it all over: > > SELECT id,data INTO sample_copy FROM sample; It is not correct. This statement used to _create_ _new_ table. Correct is: insert into sample_copy select id, data from sample; > > and then you can DROP TABLE sample; > > If you need the original table name, repeat the process of > creating a new table now and copying the data over. > > Hope that helps! > > -Robby Slaughter my best regards, ---------------- Grigoriy G. Vovk