Re: redirecting query statement and output to a marked up file, using psql

From: Bosco Rama <postgres(at)boscorama(dot)com>
To: Wim Bertels <wim(dot)bertels(at)khleuven(dot)be>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: redirecting query statement and output to a marked up file, using psql
Date: 2011-02-02 20:49:32
Message-ID: 4D49C35C.2000900@boscorama.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Wim Bertels wrote:
>
> --user2
> SET SESSION AUTHORIZATION user2;
> \pset format latex
> \echo ECHO queries
> \o report/test_user2.tex
> \i structure/test_user2.sql
> "
>
> This doenst seem to work,
> as the ECHO queries output isnt written to the file (test_user2.tex)

Actions are performed as they are encountered so put the \echo *after* the
\o, like this:

SET SESSION AUTHORIZATION user2;
\pset format latex
\o report/test_user2.tex
\echo ECHO queries
\i structure/test_user2.sql

HTH,
Bosco.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Steve Crawford 2011-02-02 21:08:57 Re: Why does a normally fast query run so slow when the table is in a partition?
Previous Message Richard Broersma 2011-02-02 20:39:09 SCALE: seeking booth attendees