X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 1D658D9802 for ; Mon, 26 Sep 2005 17:39:13 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 93705-06 for ; Mon, 26 Sep 2005 20:39:09 +0000 (GMT) Received: from zrtps0kp.nortelnetworks.com (zrtps0kp.nortelnetworks.com [47.140.192.56]) by svr1.postgresql.org (Postfix) with ESMTP id B6309D9813 for ; Mon, 26 Sep 2005 17:39:09 -0300 (ADT) Received: from zrtps0m6.us.nortel.com (zrtps0m6.us.nortel.com [47.140.192.58]) by zrtps0kp.nortelnetworks.com (Switch-2.2.6/Switch-2.2.0) with ESMTP id j8QKd8307851 for ; Mon, 26 Sep 2005 16:39:09 -0400 (EDT) Received: from cash.rhiamet.com (rhiamet.us.nortel.com [47.103.243.53]) by zrtps0m6.us.nortel.com (Switch-2.2.6/Switch-2.2.0) with ESMTP id j8QKcwr24024 for ; Mon, 26 Sep 2005 16:38:59 -0400 (EDT) Received: from cash.rhiamet.com (bmetcalf@localhost [127.0.0.1]) by cash.rhiamet.com (8.13.4/8.13.4/Debian-3) with ESMTP id j8QKcvSh011096 for ; Mon, 26 Sep 2005 15:38:57 -0500 Received: from localhost (bmetcalf@localhost) by cash.rhiamet.com (8.13.4/8.13.4/Submit) with ESMTP id j8QKcuRo011092 for ; Mon, 26 Sep 2005 15:38:57 -0500 X-Authentication-Warning: cash.rhiamet.com: bmetcalf owned process doing -bs Date: Mon, 26 Sep 2005 15:38:56 -0500 (CDT) From: "Brandon Metcalf" X-X-Sender: bmetcalf@cash.rhiamet.com To: pgsql-sql@postgresql.org Subject: add column if doesn't exist Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.296 required=5 tests=[AWL=0.246, FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200509/253 X-Sequence-Number: 22800 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