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

Re: how to echo SQL commands in the output of a script

From: George Weaver <gweaver(at)shaw(dot)ca>
To: Gino Lucrezi <gino-pgadmin(at)lucrezi(dot)net>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: how to echo SQL commands in the output of a script
Date: 2004-12-18 11:43:20
Message-ID: 004001c4e4f6$c962ce40$6400a8c0@Dell4500 (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
Does the psql option -e not provide what you're looking for?


----- Original Message ----- 
From: "Gino Lucrezi" <gino-pgadmin(at)lucrezi(dot)net>
To: <pgsql-novice(at)postgresql(dot)org>
Sent: Friday, December 17, 2004 6:48 AM
Subject: [NOVICE] how to echo SQL commands in the output of a script

>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
> Gino Lucrezi
> Penta Consulting Services Srl
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

In response to

pgsql-novice by date

Next:From: Tom LaneDate: 2004-12-18 17:55:22
Subject: Re: Copying pg_control file
Previous:From: Kretschmer AndreasDate: 2004-12-18 10:50:35
Subject: Re: Copying pg_control file

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