Re: psql scripting tutorials

From: John DeSoi <desoi(at)pgedit(dot)com>
To: Artacus <artacus(at)comcast(dot)net>
Cc: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: psql scripting tutorials
Date: 2008-09-10 12:07:51
Message-ID: FD74282C-4343-49C2-87A2-A6E41E444E79@pgedit.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Sep 10, 2008, at 2:46 AM, Artacus wrote:

> Who else is doing something like this? Can psql access environmental
> variables or command line params? Or do I have to have my bash
> script write a psql script every time?

The psql \! command can execute shell commands. You can also use ``,
e.g.

=> \echo `date`
Wed Sep 10 08:07:19 EDT 2008

John DeSoi, Ph.D.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-09-10 12:26:44 Re: "Stuck" query
Previous Message Magnus Hagander 2008-09-10 11:03:10 Re: ms windows: 40% space taken double by ../pg_tblspc folder?