Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id E332D9FB30B for ; Fri, 27 Oct 2006 12:12:59 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 12515-05 for ; Fri, 27 Oct 2006 12:12:51 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.189]) by postgresql.org (Postfix) with ESMTP id 46B049FB2A0 for ; Fri, 27 Oct 2006 12:12:51 -0300 (ADT) Received: by nf-out-0910.google.com with SMTP id g2so1101386nfe for ; Fri, 27 Oct 2006 08:12:50 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=tCg1denEAZ2rXQlGTVaea7sljnXo07fv+Xvg0OTgmmJLmChhGZ92B+ByPY0z7hlok1/syfdTVku5AvdwpmzjTwlB3aBisOksfSYPEQfyx0MulUr5ByE7tRYuBFxznF3KdpoA7OA1ZPH7D//BocNXg1jaKFEm2QmFBerSWfojz3w= Received: by 10.48.254.10 with SMTP id b10mr1073768nfi; Fri, 27 Oct 2006 08:12:49 -0700 (PDT) Received: by 10.48.215.19 with HTTP; Fri, 27 Oct 2006 08:12:49 -0700 (PDT) Message-ID: <4f4c2a010610270812r65d321cejf00cb374596f2a5f@mail.gmail.com> Date: Fri, 27 Oct 2006 11:12:49 -0400 From: "Jon Horsman" To: pgsql-sql@postgresql.org Subject: Re: How to query information schema from shell script In-Reply-To: <4f4c2a010610270657we83aa70o471678507d59c6a0@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4f4c2a010610270631q73de201tb98446f64b942a0e@mail.gmail.com> <4f4c2a010610270657we83aa70o471678507d59c6a0@mail.gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.802 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, SPF_PASS X-Spam-Level: X-Archive-Number: 200610/219 X-Sequence-Number: 26608 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. Jon