From: A. Kretschmer <andreas.kretschmer@schollglas.com>
To: pgsql-sql@postgresql.org
Subject: Re: How to query information schema from shell script
Date: Fri, 27 Oct 2006 15:46:31 +0200
Message-ID: <20061027134631.GB25572@a-kretschmer.de> (raw)
In-Reply-To: <4f4c2a010610270631q73de201tb98446f64b942a0e@mail.gmail.com>
References: <4f4c2a010610270631q73de201tb98446f64b942a0e@mail.gmail.com>
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
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: andreas.kretschmer@schollglas.com
Subject: Re: How to query information schema from shell script
In-Reply-To: <20061027134631.GB25572@a-kretschmer.de>
* 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