Re: psql \o weirdness

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Ron St-Pierre <rstpierre(at)syscor(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: psql \o weirdness
Date: 2004-09-02 19:15:28
Message-ID: 200409022115.28377.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ron St-Pierre wrote:
> the line in the sql script to
> SELECT * FROM myFunction() \o /dev/null;
> output from this is suppressed. HOWEVER, I get an error when it tries
> to process the next line;
> psql:/usr/local/pgsql/quiet.sql:2: ERROR: syntax error at or near
> "SELECT" at character 26

No, what actually happens is that the first SELECT is never executed,
because there is no terminating semicolon. The semicolon at the end of
the line belongs to the \o command. So when it processes the next
line, it appends the text to the previous command and tries to execute
that invalid concatenation. What you really want to use instead is the
\g command.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Anony Mous 2004-09-02 19:32:48 location of postmaster.log on V8 Win 32
Previous Message John DeSoi 2004-09-02 18:29:23 Re: stand-alone psql