Re: psql \o weirdness

From: Ron St-Pierre <rstpierre(at)syscor(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: psql \o weirdness
Date: 2004-09-03 17:13:00
Message-ID: 4138A61C.4030502@syscor.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Peter Eisentraut wrote:

>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.
>
>
You're right Peter, the \g works. Thanks for the explanation, I can now
see why using \o wouldn't work.

Ron

In response to

Browse pgsql-general by date

  From Date Subject
Next Message John Wells 2004-09-03 19:30:26 Ingres versus PostgreSQL
Previous Message Shane Wright 2004-09-03 16:44:36 disk performance benchmarks