Skip site navigation (1) Skip section navigation (2)

Re: [INTERFACES] How do I drop a column from a table?

From: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
To: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
Cc: robertC(at)opmr(dot)com, pgsql-interfaces(at)postgreSQL(dot)org
Subject: Re: [INTERFACES] How do I drop a column from a table?
Date: 1999-08-31 13:59:38
Message-ID: 199908311359.WAA00554@ext04.sra.co.jp (view raw or flat)
Thread:
Lists: pgsql-interfaces
> > 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.
> 
> Adding columns is directly supported. Removing columns, or redefining
> them, is done with a CREATE TABLE AS/DROP TABLE/CREATE TABLE AS/DROP
> TABLE sequence, where you write the columns you want to retain into a
> temporary table, delete the original table, and then do the same back
> into a new table with the same name as the original.

But this method might lose some characteristics such as primary key,
unique constraints, no?
---
Tatsuo Ishii

Responses

pgsql-interfaces by date

Next:From: Thomas LockhartDate: 1999-08-31 14:21:53
Subject: Re: [INTERFACES] How do I drop a column from a table?
Previous:From: José Carlos FaialDate: 1999-08-31 13:21:24
Subject: ODBC Questions

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group