Thread

  1. where's ALTER TABLE table DROP [ COLUMN ] column???

    Bruno Boettcher <bboett@erm1.u-strasbg.fr> — 2001-05-23T22:49:06Z

    Hello!
    
    just trying to write an upgrade script for my bookkeeping system.... and
    noticed that it seems that i can't throw out the legacy stuff
    accumulated over time.... 
    
    as far as i can tell, i can add columns to a table, but can't remove
    them later on.....
    
    
    is this true? any easy way to circumvent this inside the DB, without
    destroying the existing tables (the problem: make backup f the existing
    table, without the offending column, drop the table, recreate it, feed
    it with the backup) if someone has any solution for this, i am taker!
    
    
    -- 
    ciao bboett
    ==============================================================
    bboett@earthling.net
    http://inforezo.u-strasbg.fr/~bboett http://erm1.u-strasbg.fr/~bboett
    ===============================================================
    the total amount of intelligence on earth is constant.
    human population is growing....
    
    
  2. Re: where's ALTER TABLE table DROP [ COLUMN ] column???

    Keith Gray <keith@heart.com.au> — 2001-05-25T06:30:17Z

    Bruno Boettcher wrote:
    > 
    > Hello!
    > 
    > as far as i can tell, i can add columns to a table, but can't remove
    > them later on.....
    > 
    > is this true? 
    
    My thought would be that somebody must have written an 
    automated version of 
    
    select [all columns except named] from [named table] into droptemp;
    drop [named table];
    select * from droptemp into [named table];
    
    Would this be available or easily written as a "rule" ??
    Could anyone familiar with the code comment?
    
    -- 
    Keith Gray
    
    
  3. Ynt: where's ALTER TABLE table DROP [ COLUMN ] column???

    Devrim GUNDUZ <devrim@oper.metu.edu.tr> — 2001-05-26T07:49:05Z

    Hi,
    
    I want to make a little correction. The correct syntax should be:
    
    SELECT [all columns except named] into mytemp1 from [$table_name] ;
    drop table [$table_name];
    SELECT * into [$table_name] from mytemp1;
    
    With regards,
    Devrim GNDZ
    
    Keith Gray <keith@heart.com.au> wrote in message
    news:3B0DFBF9.CEBDC3CC@heart.com.au...
    > Bruno Boettcher wrote:
    > >
    > > Hello!
    > >
    > > as far as i can tell, i can add columns to a table, but can't remove
    > > them later on.....
    > >
    > > is this true?
    >
    > My thought would be that somebody must have written an
    > automated version of
    >
    > select [all columns except named] from [named table] into droptemp;
    > drop [named table];
    > select * from droptemp into [named table];
    >
    > Would this be available or easily written as a "rule" ??
    > Could anyone familiar with the code comment?
    >
    > --
    > Keith Gray
    >
    > ---------------------------(end of broadcast)---------------------------
    > TIP 5: Have you checked our extensive FAQ?
    >
    > http://www.postgresql.org/users-lounge/docs/faq.html