Re: redirecting query statement and output to a marked up file, using psql - Mailing list pgsql-general

From Wim Bertels
Subject Re: redirecting query statement and output to a marked up file, using psql
Date
Msg-id 1296818891.2001.55.camel@zwerfkat
Whole thread Raw
In response to Re: redirecting query statement and output to a marked up file, using psql  (Bosco Rama <postgres@boscorama.com>)
Responses Re: redirecting query statement and output to a marked up file, using psql  (Bosco Rama <postgres@boscorama.com>)
List pgsql-general
On Fri, 2011-02-04 at 03:23 -0800, Bosco Rama wrote:
> Wim Bertels wrote:
> > On Wed, 2011-02-02 at 12:49 -0800, Bosco Rama wrote:
> >> 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
> >
> > Hallo Bosco,
> >
> > i tried changing that, but it doesnt seem to work
> > (the echo only affects the psql cmdl, but is not written to /o file)
>
> Apologies, Wim.  I meant to also indicate that you need to use the \qecho
> command.  It echoes to the query output stream whereas \echo echoes to the
> stdout.  So you would use:
>    \qecho ECHO queries

Hi Bosco,

\qecho doenst interpret parameters it just echo text, in this case 'ECHO
queries'

mvg,
Wim

>
> instead of the \echo above.
>
> Hopefully I didn't forget anything else this time. :-)
>
> HTH
>
> Bosco.
>



pgsql-general by date:

Previous
From: Bosco Rama
Date:
Subject: Re: redirecting query statement and output to a marked up file, using psql
Next
From: asia123321@op.pl
Date:
Subject: Setting configuration parameter to role and propagating it to users