Re: How to query information schema from shell script

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: How to query information schema from shell script
Date: 2006-10-27 13:46:31
Message-ID: 20061027134631.GB25572@a-kretschmer.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message George Pavlov 2006-10-27 13:47:40 Re: How to query information schema from shell script
Previous Message Jon Horsman 2006-10-27 13:31:03 How to query information schema from shell script