Re: psql: Add command to use extended query protocol - Mailing list pgsql-hackers

From Tobias Bussmann
Subject Re: psql: Add command to use extended query protocol
Date
Msg-id 53A726DF-E045-458A-9A59-C0B2F8835DD2@gmx.net
Whole thread Raw
In response to Re: psql: Add command to use extended query protocol  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Responses Re: psql: Add command to use extended query protocol
List pgsql-hackers
In one of my environments, this feature didn't work as expected. Digging into it, I found that it is incompatible with
FETCH_COUNTbeing set. Sorry for not recognising this during the betas. 

Attached a simple patch with tests running the cursor declaration through PQexecParams instead of PGexec.

Alternatively, we could avoid going to ExecQueryUsingCursor and force execution via ExecQueryAndProcessResults in
SendQuery(around line 1134 in src/bin/psql/common.c) when \bind is used: 

    else if (pset.fetch_count <= 0 || pset.gexec_flag ||
-             pset.crosstab_flag || !is_select_command(query))
+             pset.crosstab_flag || !is_select_command(query) ||
+             pset.bind_flag)

best regards
Tobias


Attachment

pgsql-hackers by date:

Previous
From: stepan rutz
Date:
Subject: Re: Detoasting optionally to make Explain-Analyze less misleading
Next
From: Thomas Munro
Date:
Subject: Re: [PATCH] Add CANONICAL option to xmlserialize