Re: PREPARE vs query with MULTIPLE statements

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrei Kovalevski <andyk(at)commandprompt(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: PREPARE vs query with MULTIPLE statements
Date: 2007-11-21 05:57:35
Message-ID: 27155.1195624655@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrei Kovalevski <andyk(at)commandprompt(dot)com> writes:
> 2) If I send it as 'PREPARE "SQL_CUR1" AS SELECT 1; SELECT 2; SELECT3;
> SELECT4;' and then 'EXECUTE "SQL_CUR1" - I'm getting:
> - results for SELECT 1; SELECT2; SELECT 3;
> - ReadyForQuery response
> - results for SELECT 4;
> - one more ReadyForQuery response
> from backend

> Is this behavour is correct and expected?

You seem to have some odd ideas about what the semicolons mean.
The prepare command there is PREPARE "SQL_CUR1" AS SELECT 1
... no more and no less.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrei Kovalevski 2007-11-21 06:10:46 Re: PREPARE vs query with MULTIPLE statements
Previous Message Andrei Kovalevski 2007-11-21 05:51:53 PREPARE vs query with MULTIPLE statements