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 4AEB9D971B for ; Mon, 26 Sep 2005 21:16:06 -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 45418-05 for ; Tue, 27 Sep 2005 00:16:02 +0000 (GMT) Received: from mail.gmx.net (imap.gmx.net [213.165.64.20]) by svr1.postgresql.org (Postfix) with SMTP id 0A4EBD977F for ; Mon, 26 Sep 2005 21:16:02 -0300 (ADT) Received: (qmail invoked by alias); 27 Sep 2005 00:16:06 -0000 Received: from dsl-082-083-222-071.arcor-ip.net (EHLO colt.pezone.net) [82.83.222.71] by mail.gmx.net (mp025) with SMTP; 27 Sep 2005 02:16:06 +0200 X-Authenticated: #495269 From: Peter Eisentraut To: "Brandon Metcalf" Subject: Re: add column if doesn't exist Date: Tue, 27 Sep 2005 02:16:04 +0200 User-Agent: KMail/1.8.1 Cc: pgsql-sql@postgresql.org References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200509270216.05141.peter_e@gmx.net> X-Y-GMX-Trusted: 0 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.017 required=5 tests=[AWL=0.017] X-Spam-Level: X-Archive-Number: 200509/255 X-Sequence-Number: 22802 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/