From: Scott Marlowe <smarlowe@g2switchworks.com>
To: Jon Horsman <horshaq@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: How to query information schema from shell script
Date: Fri, 27 Oct 2006 14:14:26 -0500
Message-ID: <1161976466.1655.1744.camel@state.g2switchworks.com> (raw)
In-Reply-To: <4f4c2a010610270812r65d321cejf00cb374596f2a5f@mail.gmail.com>
References: <4f4c2a010610270631q73de201tb98446f64b942a0e@mail.gmail.com>
<bc63ad820610270655h5bbc4fd4n797a7ea3d7e3bcdd@mail.gmail.com>
<4f4c2a010610270657we83aa70o471678507d59c6a0@mail.gmail.com>
<4f4c2a010610270812r65d321cejf00cb374596f2a5f@mail.gmail.com>
On Fri, 2006-10-27 at 10:12, Jon Horsman wrote:
> 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.
Oh, and read this:
http://www.gnu.org/software/bash/manual/bashref.html
It's a good starters manual for bash / shell programming.
For more advanced tutorials, look at:
www.deadman.org/bash.html
www.tldp.org/LDP/abc/html/index.html
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: smarlowe@g2switchworks.com, horshaq@gmail.com
Subject: Re: How to query information schema from shell script
In-Reply-To: <1161976466.1655.1744.camel@state.g2switchworks.com>
* 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