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

how to echo SQL commands in the output of a script

From: Gino Lucrezi <gino-pgadmin(at)lucrezi(dot)net>
To: pgsql-novice(at)postgresql(dot)org
Subject: how to echo SQL commands in the output of a script
Date: 2004-12-17 12:48:56
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
I have a number of sql scripts which I execute using psql -f

I can easily redirect the output for logging and archival.
However, psql will only display the result of each SQL statement, and
not the actual SQL statement.
While this is fine for most purposes, sometimes I'd rather have both
the SQL statement and its output on the same file.

Is there a way to have it?

In case I wasn't clear... did you ever do any batch programming under
MS-DOS? I need the equivalent of the ECHO ON command

Thanks in advance


Gino Lucrezi
Penta Consulting Services Srl


pgsql-novice by date

Next:From: Robert BooneDate: 2004-12-17 14:28:05
Subject: Problem with pl/perl in postgresql 8.0rc1
Previous:From: Andreas KretschmerDate: 2004-12-17 09:28:21
Subject: Re: [despammed] Reading across databases

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