From: Brandon Metcalf <bmetcalf@nortel.com>
To: pgsql-sql@postgresql.org
Subject: add column if doesn't exist
Date: Mon, 26 Sep 2005 15:38:56 -0500 (CDT)
Message-ID: <Pine.LNX.4.58L.0509261534430.1453@cash.rhiamet.com> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: bmetcalf@nortel.com
Subject: Re: add column if doesn't exist
In-Reply-To: <Pine.LNX.4.58L.0509261534430.1453@cash.rhiamet.com>
References: <Pine.LNX.4.58L.0509261534430.1453@cash.rhiamet.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox