add column if doesn't exist

From: "Brandon Metcalf" <bmetcalf(at)nortel(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: add column if doesn't exist
Date: 2005-09-26 20:38:56
Message-ID: Pine.LNX.4.58L.0509261534430.1453@cash.rhiamet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Is there a way to check for the existence of a column in a table other
than, say, doing a SELECT on that column name and checking the output?

I'm basically looking to do an ALTER TABLE foo ADD COLUMN bar if bar
doesn't exist.

Thanks.

--
Brandon

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Fuhr 2005-09-26 21:33:09 Re: Updating cidr column with network operator
Previous Message Chris Browne 2005-09-26 18:21:35 Re: Possible to delete record from all tables at the same time?