Skip to content

Commit d76606f

Browse files
committed
Doc: remove misleading info about ecpg's CONNECT/DISCONNECT DEFAULT.
As far as I can see, ecpg has no notion of a "default" open connection. You can do "CONNECT TO DEFAULT" but that just specifies letting libpq use all its default connection parameters --- the resulting connection is not special subsequently. In particular, SET CONNECTION = DEFAULT and DISCONNECT DEFAULT simply act on a connection named DEFAULT, if you've made one; they do not have special lookup rules. But the documentation of these commands makes it look like they do. Simplest fix, I think, is just to remove the paras suggesting that DEFAULT is special here. Also, SET CONNECTION *does* have one special lookup rule, which is that it recognizes CURRENT as an alias for the currently selected connection. SET CONNECTION = CURRENT is a no-op, so it's pretty useless, but nonetheless it does something different from selecting a connection by name; so we'd better document it. Per report from Sylvain Frandaz. Back-patch to all supported versions. Discussion: https://postgr.es/m/169824721149.1769274.1553568436817652238@wrigleys.postgresql.org
1 parent cf352dd commit d76606f

File tree

1 file changed

+3
-21
lines changed

1 file changed

+3
-21
lines changed

doc/src/sgml/ecpg.sgml

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -412,12 +412,6 @@ EXEC SQL DISCONNECT <optional><replaceable>connection</replaceable></optional>;
412412
</simpara>
413413
</listitem>
414414

415-
<listitem>
416-
<simpara>
417-
<literal>DEFAULT</literal>
418-
</simpara>
419-
</listitem>
420-
421415
<listitem>
422416
<simpara>
423417
<literal>CURRENT</literal>
@@ -7128,7 +7122,6 @@ EXEC SQL DEALLOCATE DESCRIPTOR mydesc;
71287122
<synopsis>
71297123
DISCONNECT <replaceable class="parameter">connection_name</replaceable>
71307124
DISCONNECT [ CURRENT ]
7131-
DISCONNECT DEFAULT
71327125
DISCONNECT ALL
71337126
</synopsis>
71347127
</refsynopsisdiv>
@@ -7169,15 +7162,6 @@ DISCONNECT ALL
71697162
</listitem>
71707163
</varlistentry>
71717164

7172-
<varlistentry id="ecpg-sql-disconnect-default">
7173-
<term><literal>DEFAULT</literal></term>
7174-
<listitem>
7175-
<para>
7176-
Close the default connection.
7177-
</para>
7178-
</listitem>
7179-
</varlistentry>
7180-
71817165
<varlistentry id="ecpg-sql-disconnect-all">
71827166
<term><literal>ALL</literal></term>
71837167
<listitem>
@@ -7196,13 +7180,11 @@ DISCONNECT ALL
71967180
int
71977181
main(void)
71987182
{
7199-
EXEC SQL CONNECT TO testdb AS DEFAULT USER testuser;
72007183
EXEC SQL CONNECT TO testdb AS con1 USER testuser;
72017184
EXEC SQL CONNECT TO testdb AS con2 USER testuser;
72027185
EXEC SQL CONNECT TO testdb AS con3 USER testuser;
72037186

72047187
EXEC SQL DISCONNECT CURRENT; /* close con3 */
7205-
EXEC SQL DISCONNECT DEFAULT; /* close DEFAULT */
72067188
EXEC SQL DISCONNECT ALL; /* close con2 and con1 */
72077189

72087190
return 0;
@@ -7770,11 +7752,11 @@ SET CONNECTION [ TO | = ] <replaceable class="parameter">connection_name</replac
77707752
</listitem>
77717753
</varlistentry>
77727754

7773-
<varlistentry id="ecpg-sql-set-connection-default">
7774-
<term><literal>DEFAULT</literal></term>
7755+
<varlistentry id="ecpg-sql-set-connection-current">
7756+
<term><literal>CURRENT</literal></term>
77757757
<listitem>
77767758
<para>
7777-
Set the connection to the default connection.
7759+
Set the connection to the current connection (thus, nothing happens).
77787760
</para>
77797761
</listitem>
77807762
</varlistentry>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy