improve PQexec documentation

Поиск
Список
Период
Сортировка
От Fabien COELHO
Тема improve PQexec documentation
Дата
Msg-id alpine.DEB.2.21.1904121016310.8912@lancre
обсуждение исходный текст
Ответы Re: improve PQexec documentation  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
Hello devs,

I'm looking at psql's use of PQexec for implementing some feature.

When running with multiple SQL commands, the doc is not very helpful.

From the source code I gathered that PQexec returns the first COPY results 
if any, and if not the last non-empty results, unless all is empty in 
which case an empty result is returned. So * marks the returned result
in the following examples:

   INSERT ... \; * COPY ... \; SELECT ... \; \;
   SELECT ... \; UPDATE ... \; * SELECT ... \; \;
   \; \; * ;

The attached patch tries to improve the documentation based on my 
understanding.

IMVHO, psql's code is kind of a mess to work around this strange behavior, 
as there is a loop over results within PQexec, then another one after 
PQexec if there were some COPY.

-- 
Fabien.
Вложения

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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: [PATCH v20] GSSAPI encryption support
Следующее
От: Haribabu Kommi
Дата:
Сообщение: Re: Attempt to consolidate reading of XLOG page