| From: | "Devinder K Rajput" <Devinder(dot)Rajput(at)ipaper(dot)com> | 
|---|---|
| To: | Postgres Admin List <pgsql-admin(at)postgresql(dot)org> | 
| Subject: | Re: removing fields | 
| Date: | 2002-09-26 00:56:32 | 
| Message-ID: | OFC862879A.E89A72D7-ON86256C40.00048AE5@ipaper.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-admin | 
Yoou could do the following:
SELECT  list_of_all_columns_you_want_to_keep
INTO TABLE new_table
FROM old_table;
DROP TABLE old_table;
ALTER TABLE new_table RENAME TO old_table;
I saw this in Bruce Momjian'n book "PostgreSQL Introduction and Concepts".
Regards
Devinder Rajput
Stores Division Corporate Offices
Chicago, IL
(773) 442-6474
                                                                                                                           
                    Andrew Sullivan                                                                                        
                    <andrew(at)libertyrms(dot)inf       To:     Postgres Admin List <pgsql-admin(at)postgresql(dot)org>                  
                    o>                           cc:                                                                       
                    Sent by:                     Subject:     Re: [ADMIN] removing fields                                  
                    pgsql-admin-owner(at)post                                                                                 
                    gresql.org                                                                                             
                                                                                                                           
                                                                                                                           
                    09/25/2002 01:41 PM                                                                                    
                                                                                                                           
                                                                                                                           
On Wed, Sep 25, 2002 at 10:34:47AM -0400, Jodi Kanter wrote:
> Does version 7.2 of Postgresql allow us to remove a column from a
> table?
No.
> syntax wrong. I thought this was a feature that was going to be
> added??
Yes. 7.3.
A
--
----
Andrew Sullivan                         204-4141 Yonge Street
Liberty RMS                           Toronto, Ontario Canada
<andrew(at)libertyrms(dot)info>                              M2P 2A8
                                         +1 416 646 3304 x110
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Serguei A. Mokhov | 2002-09-26 05:22:20 | Re: server error messages language | 
| Previous Message | Peter Eisentraut | 2002-09-25 22:06:19 | Re: Error building on SCO |