Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: How to query information schema from shell script



simplest might be psql -l.

> -----Original Message-----
> From: pgsql-sql-owner(at)postgresql(dot)org 
> [mailto:pgsql-sql-owner(at)postgresql(dot)org] On Behalf Of Jon Horsman
> Sent: Friday, October 27, 2006 8:13 AM
> To: pgsql-sql(at)postgresql(dot)org
> Subject: Re: [SQL] How to query information schema from shell script
> 
> 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



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group