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

Commit70b59a2

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 parent5a4c21e commit70b59a2

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

‎doc/src/sgml/ecpg.sgml

Lines changed: 2 additions & 20 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>
@@ -7093,7 +7087,6 @@ EXEC SQL DEALLOCATE DESCRIPTOR mydesc;
70937087
<synopsis>
70947088
DISCONNECT <replaceable class="parameter">connection_name</replaceable>
70957089
DISCONNECT [ CURRENT ]
7096-
DISCONNECT DEFAULT
70977090
DISCONNECT ALL
70987091
</synopsis>
70997092
</refsynopsisdiv>
@@ -7134,15 +7127,6 @@ DISCONNECT ALL
71347127
</listitem>
71357128
</varlistentry>
71367129

7137-
<varlistentry>
7138-
<term><literal>DEFAULT</literal></term>
7139-
<listitem>
7140-
<para>
7141-
Close the default connection.
7142-
</para>
7143-
</listitem>
7144-
</varlistentry>
7145-
71467130
<varlistentry>
71477131
<term><literal>ALL</literal></term>
71487132
<listitem>
@@ -7161,13 +7145,11 @@ DISCONNECT ALL
71617145
int
71627146
main(void)
71637147
{
7164-
EXEC SQL CONNECT TO testdb AS DEFAULT USER testuser;
71657148
EXEC SQL CONNECT TO testdb AS con1 USER testuser;
71667149
EXEC SQL CONNECT TO testdb AS con2 USER testuser;
71677150
EXEC SQL CONNECT TO testdb AS con3 USER testuser;
71687151

71697152
EXEC SQL DISCONNECT CURRENT; /* close con3 */
7170-
EXEC SQL DISCONNECT DEFAULT; /* close DEFAULT */
71717153
EXEC SQL DISCONNECT ALL; /* close con2 and con1 */
71727154

71737155
return 0;
@@ -7736,10 +7718,10 @@ SET CONNECTION [ TO | = ] <replaceable class="parameter">connection_name</replac
77367718
</varlistentry>
77377719

77387720
<varlistentry>
7739-
<term><literal>DEFAULT</literal></term>
7721+
<term><literal>CURRENT</literal></term>
77407722
<listitem>
77417723
<para>
7742-
Set the connection to thedefault connection.
7724+
Set the connection to thecurrent connection (thus, nothing happens).
77437725
</para>
77447726
</listitem>
77457727
</varlistentry>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp