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

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 (view raw or flat)
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

pgsql-general by date

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

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