From d583823aa9c8bdb622da59050eeff13e13460e21 Mon Sep 17 00:00:00 2001 From: Lars Kanis Date: Sun, 24 Nov 2024 20:19:32 +0100 Subject: [PATCH] Improve documentation of close_prepared/portal --- ext/pg_connection.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ext/pg_connection.c b/ext/pg_connection.c index ddaeaa74..22b7d9af 100644 --- a/ext/pg_connection.c +++ b/ext/pg_connection.c @@ -3604,8 +3604,9 @@ pgconn_async_describe_prepared(VALUE self, VALUE stmt_name) * Submits a request to close the specified prepared statement, and waits for completion. * close_prepared allows an application to close a previously prepared statement. * Closing a statement releases all of its associated resources on the server and allows its name to be reused. + * It's the same as using the +DEALLOCATE+ SQL statement, but on a lower protocol level. * - * statement_name can be "" or +nil+ to reference the unnamed statement. + * +statement_name+ can be "" or +nil+ to reference the unnamed statement. * It is fine if no statement exists with this name, in that case the operation is a no-op. * On success, a PG::Result with status PGRES_COMMAND_OK is returned. * @@ -3629,6 +3630,10 @@ pgconn_async_close_prepared(VALUE self, VALUE stmt_name) * Closing a portal releases all of its associated resources on the server and allows its name to be reused. * (pg does not provide any direct access to portals, but you can use this function to close a cursor created with a DECLARE CURSOR SQL command.) * + * +portal_name+ can be "" or +nil+ to reference the unnamed portal. + * It is fine if no portal exists with this name, in that case the operation is a no-op. + * On success, a PG::Result with status PGRES_COMMAND_OK is returned. + * * See also corresponding {libpq function}[https://www.postgresql.org/docs/current/libpq-exec.html#LIBPQ-PQCLOSEPORTAL]. * * Available since PostgreSQL-17.