Re: How to echo statements in sourced file? - Mailing list pgsql-general

From Kynn Jones
Subject Re: How to echo statements in sourced file?
Date
Msg-id c2350ba40812040953y5deece4p4ebc8b834213c1ce@mail.gmail.com
Whole thread Raw
In response to How to echo statements in sourced file?  ("Kynn Jones" <kynnjo@gmail.com>)
List pgsql-general
Thank you all.  From your replies I was able to figure out what I needed: "\set ECHO queries"

Kynn


On Wed, Dec 3, 2008 at 7:14 PM, Kynn Jones <kynnjo@gmail.com> wrote:
Hi.  I have a collection of SQL statements stored in a file that I run periodically via cron.  Running this "script" takes a bit too long, even for a cron job, and I would like to profile it.

I learned from Andreas Kretschmer (in another thread, in the pgsql-performance list) about the \timing directive, which is useful for this.

Now, after turning timing on, when I "source" the script from within psql, with

mydb=> \i /path/to/my/script

...I get output lines like this

Time: 38.519 ms

right in my psql terminal after each statement in the file gets executed.

But now I need a way to have these statements that are being timed themselves echoed to the terminal.  Is there a way to do this?

TIA!

Kynn


pgsql-general by date:

Previous
From: "Richard Broersma"
Date:
Subject: Re: Q: inheritance
Next
From: Carson Farmer
Date:
Subject: cumulative count