8000 Doc: remove misleading info about ecpg's CONNECT/DISCONNECT DEFAULT. · Giperboloid/postgres@bddc2f7 · GitHub
[go: up one dir, main page]

Skip to content

Commit bddc2f7

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 fdeb6e6 commit bddc2f7

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>
@@ -7130,7 +7124,6 @@ EXEC SQL DEALLOCATE DESCRIPTOR mydesc;
71307124
<synopsis>
71317125
DISCONNECT <replaceable class="parameter">connection_name</replaceable>
71327126
DISCONNECT [ CURRENT ]
7133-
DISCONNECT DEFAULT
71347127
DISCONNECT ALL
71357128
</synopsis>
71367129
</refsynopsisdiv>
@@ -7171,15 +7164,6 @@ DISCONNECT ALL
71717164
</listitem>
71727165
</varlistentry>
71737166

7174-
<varlistentry id="ecpg-sql-disconnect-default">
7175-
<term><literal>DEFAULT</literal></term>
7176-
<listitem>
7177-
<para>
7178-
Close the default connection.
7179-
</para>
7180-
</listitem>
7181-
</varlistentry>
7182-
71837167
<varlistentry id="ecpg-sql-disconnect-all">
71847168
<term><literal>ALL</literal></term>
71857169
<listitem>
@@ -7198,13 +7182,11 @@ DISCONNECT ALL
71987182
int
71997183
main(void)
72007184
{
7201-
EXEC SQL CONNECT TO testdb AS DEFAULT USER testuser;
72027185
EXEC SQL CONNECT TO testdb AS con1 USER testuser;
72037186
EXEC SQL CONNECT TO testdb AS con2 USER testuser;
72047187
EXEC SQL CONNECT TO testdb AS con3 USER testuser;
72057188

72067189
EXEC SQL DISCONNECT CURRENT; /* close con3 */
7207-
EXEC SQL DISCONNECT DEFAULT; /* close DEFAULT */
72087190
EXEC SQL DISCONNECT ALL; /* close con2 and con1 */
72097191

72107192
return 0;
@@ -7772,11 +7754,11 @@ SET CONNECTION [ TO | = ] <replaceable class="parameter">connection_name</replac
77727754
</listitem>
77737755
</varlistentry>
77747756

7775-
<varlistentry id="ecpg-sql-set-connection-default">
7776-
<term><literal>DEFAULT</literal></term>
7757+
<varlistentry id="ecpg-sql-set-connection-current">
7758+
<term><literal>CURRENT</literal></term>
77777759
<listitem>
77787760
<para>
7779-
Set the connection to the default connection.
7761+
Set the connection to the current connection (thus, nothing happens).
77807762
</para>
77817763
</listitem>
77827764
</varlistentry>

0 commit comments

Comments
 (0)
0