Skip to content

Commit 0ddd069

Browse files
authored
Merge branch 'postgres:master' into master
2 parents 97c9364 + daf9bdc commit 0ddd069

File tree

14 files changed

+458
-678
lines changed

14 files changed

+458
-678
lines changed

doc/src/sgml/pgoverexplain.sgml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</indexterm>
99

1010
<para>
11-
The <filename>pg_overexplain</filename> extends <command>EXPLAIN</command>
11+
The <filename>pg_overexplain</filename> module extends <command>EXPLAIN</command>
1212
with new options that provide additional output. It is mostly intended to
1313
assist with debugging of and development of the planner, rather than for
1414
general use. Since this module displays internal details of planner data
@@ -17,6 +17,21 @@
1717
often as) those data structures change.
1818
</para>
1919

20+
<para>
21+
To use it, simply load it into the server. You can load it into an
22+
individual session:
23+
24+
<programlisting>
25+
LOAD 'pg_overexplain';
26+
</programlisting>
27+
28+
You can also preload it into some or all sessions by including
29+
<literal>pg_overexplain</literal> in
30+
<xref linkend="guc-session-preload-libraries"/> or
31+
<xref linkend="guc-shared-preload-libraries"/> in
32+
<filename>postgresql.conf</filename>.
33+
</para>
34+
2035
<sect2 id="pgoverexplain-debug">
2136
<title>EXPLAIN (DEBUG)</title>
2237

doc/src/sgml/query.sgml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,18 @@ COPY weather FROM '/home/user/weather.txt';
264264

265265
where the file name for the source file must be available on the
266266
machine running the backend process, not the client, since the backend process
267-
reads the file directly. You can read more about the
268-
<command>COPY</command> command in <xref linkend="sql-copy"/>.
267+
reads the file directly. The data inserted above into the weather table
268+
could also be inserted from a file containing (values are separated by a
269+
tab character):
270+
271+
<programlisting>
272+
San Francisco 46 50 0.25 1994-11-27
273+
San Francisco 43 57 0.0 1994-11-29
274+
Hayward 37 54 \N 1994-11-29
275+
</programlisting>
276+
277+
You can read more about the <command>COPY</command> command in
278+
<xref linkend="sql-copy"/>.
269279
</para>
270280
</sect1>
271281

src/backend/executor/execExprInterp.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5228,7 +5228,6 @@ ExecEvalJsonCoercionFinish(ExprState *state, ExprEvalStep *op)
52285228
* JsonBehavior expression.
52295229
*/
52305230
jsestate->escontext.error_occurred = false;
5231-
jsestate->escontext.error_occurred = false;
52325231
jsestate->escontext.details_wanted = true;
52335232
}
52345233
}

src/backend/storage/lmgr/lwlock.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ static const char *const BuiltinTrancheNames[] = {
170170
[LWTRANCHE_DSM_REGISTRY_DSA] = "DSMRegistryDSA",
171171
[LWTRANCHE_DSM_REGISTRY_HASH] = "DSMRegistryHash",
172172
[LWTRANCHE_COMMITTS_SLRU] = "CommitTsSLRU",
173-
[LWTRANCHE_MULTIXACTOFFSET_SLRU] = "MultixactOffsetSLRU",
174-
[LWTRANCHE_MULTIXACTMEMBER_SLRU] = "MultixactMemberSLRU",
173+
[LWTRANCHE_MULTIXACTOFFSET_SLRU] = "MultiXactOffsetSLRU",
174+
[LWTRANCHE_MULTIXACTMEMBER_SLRU] = "MultiXactMemberSLRU",
175175
[LWTRANCHE_NOTIFY_SLRU] = "NotifySLRU",
176176
[LWTRANCHE_SERIAL_SLRU] = "SerialSLRU",
177177
[LWTRANCHE_SUBTRANS_SLRU] = "SubtransSLRU",

src/backend/tcop/pquery.c

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,24 +1350,15 @@ PortalRunMulti(Portal portal,
13501350
PopActiveSnapshot();
13511351

13521352
/*
1353-
* If a query completion data was supplied, use it. Otherwise use the
1354-
* portal's query completion data.
1355-
*
1356-
* Exception: Clients expect INSERT/UPDATE/DELETE tags to have counts, so
1357-
* fake them with zeros. This can happen with DO INSTEAD rules if there
1358-
* is no replacement query of the same type as the original. We print "0
1359-
* 0" here because technically there is no query of the matching tag type,
1360-
* and printing a non-zero count for a different query type seems wrong,
1361-
* e.g. an INSERT that does an UPDATE instead should not print "0 1" if
1362-
* one row was updated. See QueryRewrite(), step 3, for details.
1353+
* If a command tag was requested and we did not fill in a run-time-
1354+
* determined tag above, copy the parse-time tag from the Portal. (There
1355+
* might not be any tag there either, in edge cases such as empty prepared
1356+
* statements. That's OK.)
13631357
*/
1364-
if (qc && qc->commandTag == CMDTAG_UNKNOWN)
1365-
{
1366-
if (portal->qc.commandTag != CMDTAG_UNKNOWN)
1367-
CopyQueryCompletion(qc, &portal->qc);
1368-
/* If the caller supplied a qc, we should have set it by now. */
1369-
Assert(qc->commandTag != CMDTAG_UNKNOWN);
1370-
}
1358+
if (qc &&
1359+
qc->commandTag == CMDTAG_UNKNOWN &&
1360+
portal->qc.commandTag != CMDTAG_UNKNOWN)
1361+
CopyQueryCompletion(qc, &portal->qc);
13711362
}
13721363

13731364
/*

src/interfaces/libpq/fe-connect.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7574,10 +7574,12 @@ PQport(const PGconn *conn)
75747574
if (!conn)
75757575
return NULL;
75767576

7577-
if (conn->connhost != NULL)
7577+
if (conn->connhost != NULL &&
7578+
conn->connhost[conn->whichhost].port != NULL &&
7579+
conn->connhost[conn->whichhost].port[0] != '\0')
75787580
return conn->connhost[conn->whichhost].port;
75797581

7580-
return "";
7582+
return DEF_PGPORT_STR;
75817583
}
75827584

75837585
/*

src/interfaces/libpq/libpq-int.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,8 @@ typedef struct pg_conn_host
357357
pg_conn_host_type type; /* type of host address */
358358
char *host; /* host name or socket path */
359359
char *hostaddr; /* host numeric IP address */
360-
char *port; /* port number (always provided) */
360+
char *port; /* port number (if NULL or empty, use
361+
* DEF_PGPORT[_STR]) */
361362
char *password; /* password for this host, read from the
362363
* password file; NULL if not sought or not
363364
* found in password file. */

0 commit comments

Comments
 (0)