libpq: multiple commands within single query

From: Вячеслав Блинников <slavmfm(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: libpq: multiple commands within single query
Date: 2011-01-16 00:07:13
Message-ID: AANLkTimR=EKx7Z6i6arX8JFTnGKw_90xwV=JmPdJDJsc@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

When I call PQsendQuery(..., "SELECT column1 FROM my_table; SELECT column2
FROM my_table; SELECT column3 FROM my_table") PQgetResult(...) successfully
returns three results each containing 1 row and 1 column - that is what I
need.
But when I call something like PQsendQuery(..., "SELECT column1 FROM
my_table; SELECT some_bad_column_name FROM my_table, SELECT column2 FROM
my_table; SELECT column3 FROM my_table") PQgetResult(...) returns just 2
results: first containing 1 row and 1 column and second containing 0 rows
and 0 columns.
Is it somehow possible to get two remaining results?

Browse pgsql-general by date

  From Date Subject
Next Message Alban Hertroys 2011-01-16 00:19:16 Re: Record with a field consisting of table rows
Previous Message Randall Smith 2011-01-15 22:52:11 Trigger Performance