summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorMichael Paquier2024-08-22 07:25:57 +0000
committerMichael Paquier2024-08-22 07:25:57 +0000
commitd55322b0da60a8798ffdb8b78ef90db0fb5be18e (patch)
treed6d5ff5ec0fe3f7d8c49d38357529f113ef617d3 /src/tools
parenta36aa223ec447276bf7050ab9ec6d974cafdf6c4 (diff)
psql: Add more meta-commands able to use the extended protocol
Currently, only unnamed prepared statement are supported by psql with the meta-command \bind. With only this command, it is not possible to test named statement creation, execution or close through the extended protocol. This commit introduces three additional commands: * \parse creates a prepared statement using the extended protocol, acting as a wrapper of libpq's PQsendPrepare(). * \bind_named binds and executes an existing prepared statement using the extended protocol, for PQsendQueryPrepared(). * \close closes an existing prepared statement using the extended protocol, for PQsendClosePrepared(). This is going to be useful to add regression tests for the extended query protocol, and I have some plans for that on separate threads. Note that \bind relies on PQsendQueryParams(). The code of psql is refactored so as bind_flag is replaced by an enum in _psqlSettings that tracks the type of libpq routine to execute, based on the meta-command involved, with the default being PQsendQuery(). This refactoring piece has been written by me, while Anthonin has implemented the rest. Author: Anthonin Bonnefoy, Michael Paquier Reviewed-by: Aleksander Alekseev, Jelte Fennema-Nio Discussion: https://postgr.es/m/CAO6_XqpSq0Q0kQcVLCbtagY94V2GxNP3zCnR6WnOM8WqXPK4nw@mail.gmail.com
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/pgindent/typedefs.list1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list
index 6d424c89186..3f3a8f2634b 100644
--- a/src/tools/pgindent/typedefs.list
+++ b/src/tools/pgindent/typedefs.list
@@ -1958,6 +1958,7 @@ PSQL_COMP_CASE
PSQL_ECHO
PSQL_ECHO_HIDDEN
PSQL_ERROR_ROLLBACK
+PSQL_SEND_MODE
PTEntryArray
PTIterationArray
PTOKEN_PRIVILEGES