pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter_e@gmx.net>
To: Brandon Metcalf <bmetcalf@nortel.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: add column if doesn't exist
Date: Tue, 27 Sep 2005 02:16:04 +0200
Message-ID: <200509270216.05141.peter_e@gmx.net> (raw)
In-Reply-To: <Pine.LNX.4.58L.0509261534430.1453@cash.rhiamet.com>
References: <Pine.LNX.4.58L.0509261534430.1453@cash.rhiamet.com>

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/



view thread (5+ messages)  latest in thread

Message-ID: <200509270216.05141.peter_e@gmx.net>
Permalink:  ../200509270216.05141.peter_e@gmx.net/
Also on:    postgresql.org/message-id/200509270216.05141.peter_e@gmx.net

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: peter_e@gmx.net, bmetcalf@nortel.com
  Subject: Re: add column if doesn't exist
  In-Reply-To: <200509270216.05141.peter_e@gmx.net>

* 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