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

Re: Examples of accessing postgresql with scripts?

From: Rory Campbell-Lange <rory(at)campbell-lange(dot)net>
To: hodges(at)xprt(dot)net
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Examples of accessing postgresql with scripts?
Date: 2003-05-27 16:47:24
Message-ID: 20030527164724.GB2445@campbell-lange.net (view raw or flat)
Thread:
Lists: pgsql-novice
psql -d <dbname> [-U <user>] -c "<command>"

eg (if you do not need to log in as a user):
psql -d temporary -c "select * from people;"

On 27/05/03, hodges(at)xprt(dot)net (hodges(at)xprt(dot)net) wrote:
> Can anyone direct me to some example bash scripts that
> execute queries thru psql?
> 
> I need to check a bunch of tables for dates as a background
> job daily.  Seems like bash, perl, or python might be good
> ways to do this.  I think I know enough perl to do it but
> maybe bash or python would be better choices?

-- 
Rory Campbell-Lange 
<rory(at)campbell-lange(dot)net>
<www.campbell-lange.net>

In response to

Responses

pgsql-novice by date

Next:From: Nabil SayeghDate: 2003-05-27 17:03:13
Subject: Re: Examples of accessing postgresql with scripts?
Previous:From: Rory Campbell-LangeDate: 2003-05-27 16:42:25
Subject: Re: reuse RECORD in function 'select into'?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group