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

Commitd76606f

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" 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 parentcf352dd commitd76606f

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp