Received: from mail.utexas.edu (wb1-a.mail.utexas.edu [128.83.126.134]) by postgresql.org (8.11.3/8.11.4) with SMTP id f774Xm658091 for ; Tue, 7 Aug 2001 00:33:48 -0400 (EDT) (envelope-from webmaster@robbyslaughter.com) Received: (qmail 14958 invoked by uid 0); 7 Aug 2001 04:33:47 -0000 Received: from adsl-65-67-62-24.dsl.austtx.swbell.net (HELO robmanbox) (65.67.62.24) by umbs-smtp-1 with SMTP; 7 Aug 2001 04:33:47 -0000 Reply-To: From: "Robby Slaughter" To: "Suhadi" , "SQL" Subject: RE: Delete coloumn Date: Mon, 6 Aug 2001 23:35:53 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 In-Reply-To: <20010807041600.9821.qmail@mail.indosatcom.net> Importance: Normal X-Archive-Number: 200108/85 X-Sequence-Number: 4306 Unfortunately, there's no easy way to delete a column in a table in PostgreSQL. The standard SQL syntax is: ALTER TABLE tablename DROP COLUMN columnname; But I repeat, this is NOT supported in postgresql. If you really need to delete a column you can always just create a new table with an identical definition but WITHOUT the offending column, and then 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; 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 -----Original Message----- From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org]On Behalf Of Suhadi Sent: Monday, August 06, 2001 11:16 PM To: SQL Subject: [SQL] Delete coloumn Please send to me how to delete coloumn in SQL. Thank's ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org