Re: feature request

Поиск
Список
Период
Сортировка
От Dave Page
Тема Re: feature request
Дата
Msg-id CA+OCxozsPBA3a5d1P=YeKg7-xtdOSna0xgfBCQRzNdhs_cChyg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: feature request  (Guillaume Lelarge <guillaume@lelarge.info>)
Ответы Re: feature request  (Guillaume Lelarge <guillaume@lelarge.info>)
Список pgadmin-support
On Tue, Aug 30, 2011 at 6:15 PM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:
>>
>> libpq doesn't support multiple resultsets in a single query unfortunately.
>>
>
> As a matter of fact, it does (see
> http://pgolub.wordpress.com/2009/11/17/script-slicing-by-pgmdd/), and I
> really want pgAdmin to use this. Still need to find a good UI and some
> time to work on it :)

Err, no it doesn't. The blog you've referenced describes how PgMDD
takes the PostgreSQL 8.3 parser and uses it to pre-parse scripts into
individual statements on the client, which it then executes
individually. That's similar to what's being asked for here, but has
the rather nasty limitation of not understanding PG 8.4+'s grammar.

Libpq itself only supports a single resultset for multi-part
statements. Even in 9.1, the docs say:

The command string can include multiple SQL commands (separated by
semicolons). Multiple queries sent in a single PQexec call are
processed in a single transaction, unless there are explicit
BEGIN/COMMIT commands included in the query string to divide it into
multiple transactions. Note however that the returned PGresult
structure describes only the result of the last command executed from
the string. Should one of the commands fail, processing of the string
stops with it and the returned PGresult describes the error condition.

(http://www.postgresql.org/docs/9.1/static/libpq-exec.html#LIBPQ-EXEC-MAIN)

In other words, only the last resultset is accessible.

-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


В списке pgadmin-support по дате отправления:

Предыдущее
От: Dave Page
Дата:
Сообщение: Re: Crash editing connection properties
Следующее
От: Dave Page
Дата:
Сообщение: Re: Crash editing connection properties