Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit28e4921

Browse files
tglsfdcpull[bot]
authored andcommitted
Doc: remove misleading info about ecpg's CONNECT/DISCONNECT DEFAULT.
As far as I can see, ecpg has no notion of a "default" openconnection. You can do "CONNECT TO DEFAULT" but that just specifiesletting libpq use all its default connection parameters --- theresulting connection is not special subsequently. In particular,SET CONNECTION = DEFAULT and DISCONNECT DEFAULT simply act on aconnection named DEFAULT, if you've made one; they do not havespecial lookup rules. But the documentation of these commandsmakes it look like they do.Simplest fix, I think, is just to remove the paras suggesting thatDEFAULT is special here.Also, SET CONNECTION *does* have one special lookup rule, whichis that it recognizes CURRENT as an alias for the currently selectedconnection. SET CONNECTION = CURRENT is a no-op, so it's prettyuseless, but nonetheless it does something different from selectinga connection by name; so we'd better document it.Per report from Sylvain Frandaz. Back-patch to all supportedversions.Discussion:https://postgr.es/m/169824721149.1769274.1553568436817652238@wrigleys.postgresql.org
1 parent1f3ffbe commit28e4921

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 thedefault connection.
7761+
Set the connection to thecurrent connection (thus, nothing happens).
77807762
</para>
77817763
</listitem>
77827764
</varlistentry>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp