libpq: multiple commands within single query

Поиск
Список
Период
Сортировка
От Вячеслав Блинников
Тема libpq: multiple commands within single query
Дата
Msg-id AANLkTimdCPcu=ogZJekLHVtoGmtyPn8wTUeRn8dET6-g@mail.gmail.com
обсуждение исходный текст
Ответы Re: libpq: multiple commands within single query
Список pgsql-general
By which rules database returns results for multiple commands within single query?
For example I send (execute) such query (obtain different information about just connected client):
"SELECT column1 FROM table1; SELECT column2 FROM table2; SELECT column3 FROM table3;"
And when I get response I expect some results (PGresult structure) for EACH "SELECT" - so there must be 3 PGresult structures and if one of results contains zero rows - it means that there are no data (of such type) for such client yet, but there still can be some data for following "SELECT". For example (referring to previous example) response can contain 3 results (as I expect) where first contains 1 row, second 0 rows and third 1 row. So when I examine the response I can match each PGresult to each "SELECT".
Does it works on this way? Or I missed something?

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

Предыдущее
От: "Muhammad Soultani"
Дата:
Сообщение: read and restore deleted record
Следующее
От: Dmitriy Igrishin
Дата:
Сообщение: Re: libpq: multiple commands within single query