Re: add column if doesn't exist

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: "Brandon Metcalf" <bmetcalf(at)nortel(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: add column if doesn't exist
Date: 2005-09-27 00:16:04
Message-ID: 200509270216.05141.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Brandon Metcalf wrote:
> 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?

SELECT * FROM information_schema.columns;

Customize to taste.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message jeff sacksteder 2005-09-27 00:34:14 how to do 'deep queries'?
Previous Message Michael Fuhr 2005-09-26 21:33:09 Re: Updating cidr column with network operator