Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 720D69FB25A for ; Sat, 28 Oct 2006 01:09:45 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 83228-04 for ; Sat, 28 Oct 2006 04:09:40 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from web31804.mail.mud.yahoo.com (web31804.mail.mud.yahoo.com [68.142.207.67]) by postgresql.org (Postfix) with SMTP id 178309F9F7D for ; Sat, 28 Oct 2006 01:09:36 -0300 (ADT) Received: (qmail 2370 invoked by uid 60001); 28 Oct 2006 04:09:35 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=29X5IJtcG+y5hJ47qgCUFU+HLitlZhf3uIEwaXTUFlsnJg2cjkkJQhp8NiIiFZJKNMvoA/lUP+vbVR8fy58GtWzpStf/PhiqESUlrQcFLa5tZLHO+U1odaMKDClEgC6tPZTTKLPwTbeQ1/7TxYRXj5XEaXmO19y4vyccxeLwb5Y= ; X-YMail-OSG: RJ7vXcYVM1m4GE2uJHxnHBL4hTJfiJ7rxbI8SxOUH6j69LC6axBY0KXDS0.Sw6gddWHG5HVVn1c5IZSOEBnDZEHsOzMYg94lqQX3becoRV.GRiAsFNPe3vjLFjpQBsP8v7ryY5PJMjR0v5jbJJO6_vPRAH8mopvmR1yS03NkI7wU7s0hZlJY0T6UoC7N Received: from [24.54.196.198] by web31804.mail.mud.yahoo.com via HTTP; Fri, 27 Oct 2006 21:09:35 PDT Date: Fri, 27 Oct 2006 21:09:35 -0700 (PDT) From: Richard Broersma Jr Subject: Re: How to query information schema from shell script To: Jon Horsman , pgsql-sql@postgresql.org In-Reply-To: <4f4c2a010610270812r65d321cejf00cb374596f2a5f@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <840218.2181.qm@web31804.mail.mud.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=3.355 tagged_above=0 required=5 tests=DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, DNS_FROM_RFC_WHOIS X-Spam-Level: *** X-Archive-Number: 200610/228 X-Sequence-Number: 26617 > In my original email i forgot to mentioned i need to know if the > database exists or not from the shell script. If it doesn't exist i > would then create it. Currently i was just creating the db everytime > our db script is run (since it doesn't hurt the db) but this generates > the 'db already exists' log and I now have the requirement that the > users not see that log. ie, don't run createdb if it already exists. > > In looking through the postgres docs i can see how to check if a table > exists but not how a db exists. > > Again, thanks for the help. psql -l Regards, Richard Broersma Jr.