Re: How to query information schema from shell script - Mailing list pgsql-sql

From A. Kretschmer
Subject Re: How to query information schema from shell script
Date
Msg-id 20061027134631.GB25572@a-kretschmer.de
Whole thread Raw
In response to How to query information schema from shell script  ("Jon Horsman" <horshaq@gmail.com>)
List pgsql-sql
am  Fri, dem 27.10.2006, um  9:31:03 -0400 mailte Jon Horsman folgendes:
> Hey,
> 
> I'm trying to figure out how i can query the postgres information
> schema from a bourne shell script on linux.  I need to know if a
> user/table exists.  Does someone mind giving me a quick example of how

You can do something like this:

bla=`echo "select bla from fasel" | psql -t`

You have then the result in $bla.


Andreas
-- 
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47215,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net


pgsql-sql by date:

Previous
From: "George Pavlov"
Date:
Subject: Re: How to query information schema from shell script
Next
From: "William Leite Araújo"
Date:
Subject: Re: How to query information schema from shell script