Re: postgres via shell scripts

From: bmccoy(at)chapelperilous(dot)net
To: Mike Sears <msears(at)vianet(dot)ca>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: postgres via shell scripts
Date: 2000-10-06 15:17:08
Message-ID: Pine.LNX.4.10.10010061113260.5786-100000@chapelperilous.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 6 Oct 2000, Mike Sears wrote:

> Is there away to access a postgres database using a shell script, like bash
> or korn?

You can use

psql -c <query>

or

psql -f <filename>

to do command-line stuff inside of a script. But then you have to figure
out how to parse the result. You're probably better off going the next
step and using Perl.

Brett W. McCoy
http://www.chapelperilous.net
---------------------------------------------------------------------------
Imagination is more important than knowledge.
-- Albert Einstein

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jim Mercer 2000-10-06 15:19:03 Re: postgres via shell scripts
Previous Message Mike Sears 2000-10-06 14:57:52 postgres via shell scripts