@@ -3250,10 +3250,7 @@ PGresult *PQprepare(PGconn *conn,
3250
3250
3251
3251
Prepared statements for use with <xref linkend="libpq-PQexecPrepared"/> can also
3252
3252
be created by executing SQL <xref linkend="sql-prepare"/>
3253
- statements. Also, although there is no <application>libpq</application>
3254
- function for deleting a prepared statement, the SQL <xref
3255
- linkend="sql-deallocate"/> statement
3256
- can be used for that purpose.
3253
+ statements.
3257
3254
</para>
3258
3255
3259
3256
<para>
@@ -3360,6 +3357,66 @@ PGresult *PQdescribePortal(PGconn *conn, const char *portalName);
3360
3357
</para>
3361
3358
</listitem>
3362
3359
</varlistentry>
3360
+
3361
+ <varlistentry id="libpq-PQclosePrepared">
3362
+ <term><function>PQclosePrepared</function><indexterm><primary>PQclosePrepared</primary></indexterm></term>
3363
+
3364
+ <listitem>
3365
+ <para>
3366
+ Submits a request to close the specified prepared statement, and waits
3367
+ for completion.
3368
+ <synopsis>
3369
+ PGresult *PQclosePrepared(PGconn *conn, const char *stmtName);
3370
+ </synopsis>
3371
+ </para>
3372
+
3373
+ <para>
3374
+ <xref linkend="libpq-PQclosePrepared"/> allows an application to close
3375
+ a previously prepared statement. Closing a statement releases all
3376
+ of its associated resources on the server and allows its name to be
3377
+ reused.
3378
+ </para>
3379
+
3380
+ <para>
3381
+ <parameter>stmtName</parameter> can be <literal>""</literal> or
3382
+ <symbol>NULL</symbol> to reference the unnamed statement. It is fine
3383
+ if no statement exists with this name, in that case the operation is a
3384
+ no-op. On success, a <structname>PGresult</structname> with
3385
+ status <literal>PGRES_COMMAND_OK</literal> is returned.
3386
+ </para>
3387
+ </listitem>
3388
+ </varlistentry>
3389
+
3390
+ <varlistentry id="libpq-PQclosePortal">
3391
+ <term><function>PQclosePortal</function><indexterm><primary>PQclosePortal</primary></indexterm></term>
3392
+
3393
+ <listitem>
3394
+ <para>
3395
+ Submits a request to close the specified portal, and waits for
3396
+ completion.
3397
+ <synopsis>
3398
+ PGresult *PQclosePortal(PGconn *conn, const char *portalName);
3399
+ </synopsis>
3400
+ </para>
3401
+
3402
+ <para>
3403
+ <xref linkend="libpq-PQclosePortal"/> allows an application to trigger
3404
+ a close of a previously created portal. Closing a portal releases all
3405
+ of its associated resources on the server and allows its name to be
3406
+ reused. (<application>libpq</application> does not provide any
3407
+ direct access to portals, but you can use this function to close a
3408
+ cursor created with a <command>DECLARE CURSOR</command> SQL command.)
3409
+ </para>
3410
+
3411
+ <para>
3412
+ <parameter>portalName</parameter> can be <literal>""</literal> or
3413
+ <symbol>NULL</symbol> to reference the unnamed portal. It is fine
3414
+ if no portal exists with this name, in that case the operation is a
3415
+ no-op. On success, a <structname>PGresult</structname> with status
3416
+ <literal>PGRES_COMMAND_OK</literal> is returned.
3417
+ </para>
3418
+ </listitem>
3419
+ </varlistentry>
3363
3420
</variablelist>
3364
3421
</para>
3365
3422
@@ -4851,15 +4908,19 @@ unsigned char *PQunescapeBytea(const unsigned char *from, size_t *to_length);
4851
4908
<xref linkend="libpq-PQsendQueryParams"/>,
4852
4909
<xref linkend="libpq-PQsendPrepare"/>,
4853
4910
<xref linkend="libpq-PQsendQueryPrepared"/>,
4854
- <xref linkend="libpq-PQsendDescribePrepared"/>, and
4911
+ <xref linkend="libpq-PQsendDescribePrepared"/>,
4855
4912
<xref linkend="libpq-PQsendDescribePortal"/>,
4913
+ <xref linkend="libpq-PQsendClosePrepared"/>, and
4914
+ <xref linkend="libpq-PQsendClosePortal"/>,
4856
4915
which can be used with <xref linkend="libpq-PQgetResult"/> to duplicate
4857
4916
the functionality of
4858
4917
<xref linkend="libpq-PQexecParams"/>,
4859
4918
<xref linkend="libpq-PQprepare"/>,
4860
4919
<xref linkend="libpq-PQexecPrepared"/>,
4861
- <xref linkend="libpq-PQdescribePrepared"/>, and
4920
+ <xref linkend="libpq-PQdescribePrepared"/>,
4862
4921
<xref linkend="libpq-PQdescribePortal"/>
4922
+ <xref linkend="libpq-PQclosePrepared"/>, and
4923
+ <xref linkend="libpq-PQclosePortal"/>
4863
4924
respectively.
4864
4925
4865
4926
<variablelist>
@@ -5008,6 +5069,46 @@ int PQsendDescribePortal(PGconn *conn, const char *portalName);
5008
5069
</listitem>
5009
5070
</varlistentry>
5010
5071
5072
+ <varlistentry id="libpq-PQsendClosePrepared">
5073
+ <term><function>PQsendClosePrepared</function><indexterm><primary>PQsendClosePrepared</primary></indexterm></term>
5074
+
5075
+ <listitem>
5076
+ <para>
5077
+ Submits a request to close the specified prepared statement, without
5078
+ waiting for completion.
5079
+ <synopsis>
5080
+ int PQsendClosePrepared(PGconn *conn, const char *stmtName);
5081
+ </synopsis>
5082
+
5083
+ This is an asynchronous version of <xref linkend="libpq-PQclosePrepared"/>:
5084
+ it returns 1 if it was able to dispatch the request, and 0 if not.
5085
+ After a successful call, call <xref linkend="libpq-PQgetResult"/> to
5086
+ obtain the results. The function's parameters are handled
5087
+ identically to <xref linkend="libpq-PQclosePrepared"/>.
5088
+ </para>
5089
+ </listitem>
5090
+ </varlistentry>
5091
+
5092
+ <varlistentry id="libpq-PQsendClosePortal">
5093
+ <term><function>PQsendClosePortal</function><indexterm><primary>PQsendClosePortal</primary></indexterm></term>
5094
+
5095
+ <listitem>
5096
+ <para>
5097
+ Submits a request to close specified portal, without waiting for
5098
+ completion.
5099
+ <synopsis>
5100
+ int PQsendClosePortal(PGconn *conn, const char *portalName);
5101
+ </synopsis>
5102
+
5103
+ This is an asynchronous version of <xref linkend="libpq-PQclosePortal"/>:
5104
+ it returns 1 if it was able to dispatch the request, and 0 if not.
5105
+ After a successful call, call <xref linkend="libpq-PQgetResult"/> to
5106
+ obtain the results. The function's parameters are handled
5107
+ identically to <xref linkend="libpq-PQclosePortal"/>.
5108
+ </para>
5109
+ </listitem>
5110
+ </varlistentry>
5111
+
5011
5112
<varlistentry id="libpq-PQgetResult">
5012
5113
<term><function>PQgetResult</function><indexterm><primary>PQgetResult</primary></indexterm></term>
5013
5114
@@ -5019,7 +5120,9 @@ int PQsendDescribePortal(PGconn *conn, const char *portalName);
5019
5120
<xref linkend="libpq-PQsendPrepare"/>,
5020
5121
<xref linkend="libpq-PQsendQueryPrepared"/>,
5021
5122
<xref linkend="libpq-PQsendDescribePrepared"/>,
5022
- <xref linkend="libpq-PQsendDescribePortal"/>, or
5123
+ <xref linkend="libpq-PQsendDescribePortal"/>,
5124
+ <xref linkend="libpq-PQsendClosePrepared"/>,
5125
+ <xref linkend="libpq-PQsendClosePortal"/>, or
5023
5126
<xref linkend="libpq-PQpipelineSync"/>
5024
5127
call, and returns it.
5025
5128
A null pointer is returned when the command is complete and there
@@ -5350,6 +5453,8 @@ int PQflush(PGconn *conn);
5350
5453
<function>PQexecPrepared</function>,
5351
5454
<function>PQdescribePrepared</function>,
5352
5455
<function>PQdescribePortal</function>,
5456
+ <function>PQclosePrepared</function>,
5457
+ <function>PQclosePortal</function>,
5353
5458
is an error condition.
5354
5459
<function>PQsendQuery</function> is
5355
5460
also disallowed, because it uses the simple query protocol.
@@ -5389,8 +5494,10 @@ int PQflush(PGconn *conn);
5389
5494
establish a synchronization point in the pipeline,
5390
5495
or when <xref linkend="libpq-PQflush"/> is called.
5391
5496
The functions <xref linkend="libpq-PQsendPrepare"/>,
5392
- <xref linkend="libpq-PQsendDescribePrepared"/>, and
5393
- <xref linkend="libpq-PQsendDescribePortal"/> also work in pipeline mode.
5497
+ <xref linkend="libpq-PQsendDescribePrepared"/>,
5498
+ <xref linkend="libpq-PQsendDescribePortal"/>,
5499
+ <xref linkend="libpq-PQsendClosePrepared"/>, and
5500
+ <xref linkend="libpq-PQsendClosePortal"/> also work in pipeline mode.
5394
5501
Result processing is described below.
5395
5502
</para>
5396
5503
0 commit comments