Skip to content

[pull] master from postgres:master #91

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions doc/src/sgml/logical-replication.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -2413,7 +2413,7 @@ CONTEXT: processing remote data for replication origin "pg_16395" during "INSER
</para>

<sect2 id="prepare-publisher-upgrades">
<title>Prepare for publisher upgrades</title>
<title>Prepare for Publisher Upgrades</title>

<para>
<application>pg_upgrade</application> attempts to migrate logical
Expand Down Expand Up @@ -2485,7 +2485,7 @@ CONTEXT: processing remote data for replication origin "pg_16395" during "INSER
</sect2>

<sect2 id="prepare-subscriber-upgrades">
<title>Prepare for subscriber upgrades</title>
<title>Prepare for Subscriber Upgrades</title>

<para>
Setup the <link linkend="logical-replication-config-subscriber">
Expand Down Expand Up @@ -2535,7 +2535,7 @@ CONTEXT: processing remote data for replication origin "pg_16395" during "INSER
</sect2>

<sect2 id="upgrading-logical-replication-clusters">
<title>Upgrading logical replication clusters</title>
<title>Upgrading Logical Replication Clusters</title>

<para>
While upgrading a subscriber, write operations can be performed in the
Expand Down Expand Up @@ -2599,7 +2599,7 @@ CONTEXT: processing remote data for replication origin "pg_16395" during "INSER
</para>

<sect3 id="steps-two-node-logical-replication-cluster">
<title>Steps to upgrade a two-node logical replication cluster</title>
<title>Steps to Upgrade a Two-node Logical Replication Cluster</title>
<para>
Let's say publisher is in <literal>node1</literal> and subscriber is
in <literal>node2</literal>. The subscriber <literal>node2</literal> has
Expand Down Expand Up @@ -2743,7 +2743,7 @@ pg_ctl -D /opt/PostgreSQL/data2_upgraded start -l logfile
</sect3>

<sect3 id="steps-cascaded-logical-replication-cluster">
<title>Steps to upgrade a cascaded logical replication cluster</title>
<title>Steps to Upgrade a Cascaded Logical Replication Cluster</title>
<para>
Let's say we have a cascaded logical replication setup
<literal>node1</literal>-><literal>node2</literal>-><literal>node3</literal>.
Expand Down Expand Up @@ -2972,7 +2972,7 @@ pg_ctl -D /opt/PostgreSQL/data3_upgraded start -l logfile
</sect3>

<sect3 id="steps-two-node-circular-logical-replication-cluster">
<title>Steps to upgrade a two-node circular logical replication cluster</title>
<title>Steps to Upgrade a Two-node Circular Logical Replication Cluster</title>
<para>
Let's say we have a circular logical replication setup
<literal>node1</literal>-><literal>node2</literal> and
Expand Down
4 changes: 2 additions & 2 deletions doc/src/sgml/protocol.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
</sect2>

<sect2 id="protocol-versions">
<title>Protocol versions</title>
<title>Protocol Versions</title>

<para>
The current, latest version of the protocol is version 3.2. However, for
Expand Down Expand Up @@ -226,7 +226,7 @@
</para>

<table id="protocol-versions-table">
<title>Protocol versions</title>
<title>Protocol Versions</title>

<tgroup cols="3">
<thead>
Expand Down
2 changes: 1 addition & 1 deletion doc/src/sgml/textsearch.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -1355,7 +1355,7 @@ ts_headline(<optional> <replaceable class="parameter">config</replaceable> <type
</itemizedlist>

<warning>
<title>Warning: Cross-site scripting (XSS) safety</title>
<title>Warning: Cross-site Scripting (XSS) Safety</title>
<para>
The output from <function>ts_headline</function> is not guaranteed to
be safe for direct inclusion in web pages. When
Expand Down
12 changes: 6 additions & 6 deletions src/bin/pg_basebackup/pg_createsubscriber.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,14 +247,14 @@ usage(void)
printf(_(" %s [OPTION]...\n"), progname);
printf(_("\nOptions:\n"));
printf(_(" -a, --all create subscriptions for all databases except template\n"
" databases or databases that don't allow connections\n"));
" databases and databases that don't allow connections\n"));
printf(_(" -d, --database=DBNAME database in which to create a subscription\n"));
printf(_(" -D, --pgdata=DATADIR location for the subscriber data directory\n"));
printf(_(" -n, --dry-run dry run, just show what would be done\n"));
printf(_(" -p, --subscriber-port=PORT subscriber port number (default %s)\n"), DEFAULT_SUB_PORT);
printf(_(" -P, --publisher-server=CONNSTR publisher connection string\n"));
printf(_(" -R, --remove=OBJECTTYPE remove all objects of the specified type from specified\n"
" databases on the subscriber; accepts: publications\n"));
" databases on the subscriber; accepts: \"%s\"\n"), "publications");
printf(_(" -s, --socketdir=DIR socket directory to use (default current dir.)\n"));
printf(_(" -t, --recovery-timeout=SECS seconds to wait for recovery to end\n"));
printf(_(" -T, --enable-two-phase enable two-phase commit for all subscriptions\n"));
Expand Down Expand Up @@ -973,7 +973,7 @@ check_publisher(const struct LogicalRepInfo *dbinfo)
pg_log_warning("two_phase option will not be enabled for replication slots");
pg_log_warning_detail("Subscriptions will be created with the two_phase option disabled. "
"Prepared transactions will be replicated at COMMIT PREPARED.");
pg_log_warning_hint("You can use --enable-two-phase switch to enable two_phase.");
pg_log_warning_hint("You can use the command-line option --enable-two-phase to enable two_phase.");
}

/*
Expand Down Expand Up @@ -2143,7 +2143,7 @@ main(int argc, char **argv)
if (!simple_string_list_member(&opt.objecttypes_to_remove, optarg))
simple_string_list_append(&opt.objecttypes_to_remove, optarg);
else
pg_fatal("object type \"%s\" is specified more than once for -R/--remove", optarg);
pg_fatal("object type \"%s\" specified more than once for -R/--remove", optarg);
break;
case 's':
opt.socket_dir = pg_strdup(optarg);
Expand Down Expand Up @@ -2214,7 +2214,7 @@ main(int argc, char **argv)

if (bad_switch)
{
pg_log_error("%s cannot be used with -a/--all", bad_switch);
pg_log_error("options %s and -a/--all cannot be used together", bad_switch);
pg_log_error_hint("Try \"%s --help\" for more information.", progname);
exit(1);
}
Expand Down Expand Up @@ -2341,7 +2341,7 @@ main(int argc, char **argv)
else
{
pg_log_error("invalid object type \"%s\" specified for -R/--remove", cell->val);
pg_log_error_hint("The valid option is: \"publications\"");
pg_log_error_hint("The valid value is: \"%s\"", "publications");
exit(1);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/bin/pg_basebackup/pg_recvlogical.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ usage(void)
printf(_("\nOptions:\n"));
printf(_(" -E, --endpos=LSN exit after receiving the specified LSN\n"));
printf(_(" --failover enable replication slot synchronization to standby servers when\n"
" creating a slot\n"));
" creating a replication slot\n"));
printf(_(" -f, --file=FILE receive log into this file, - for stdout\n"));
printf(_(" -F --fsync-interval=SECS\n"
" time between fsyncs to the output file (default: %d)\n"), (fsync_interval / 1000));
Expand Down
4 changes: 2 additions & 2 deletions src/bin/pg_basebackup/t/040_pg_createsubscriber.pl
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ sub generate_db
'--database' => $db1,
'--all',
],
qr/--database cannot be used with -a\/--all/,
qr/options --database and -a\/--all cannot be used together/,
'fail if --database is used with --all');

# run pg_createsubscriber with '--publication' and '--all' and verify
Expand All @@ -416,7 +416,7 @@ sub generate_db
'--all',
'--publication' => 'pub1',
],
qr/--publication cannot be used with -a\/--all/,
qr/options --publication and -a\/--all cannot be used together/,
'fail if --publication is used with --all');

# run pg_createsubscriber with '--all' option
Expand Down
8 changes: 4 additions & 4 deletions src/bin/pg_dump/pg_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -6936,7 +6936,7 @@ getRelationStatistics(Archive *fout, DumpableObject *rel, int32 relpages,
info->section = SECTION_POST_DATA;
break;
default:
pg_fatal("cannot dump statistics for relation kind '%c'",
pg_fatal("cannot dump statistics for relation kind \"%c\"",
info->relkind);
}

Expand Down Expand Up @@ -9461,7 +9461,7 @@ getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables)
int i_consrc;
int i_conislocal;

pg_log_info("finding invalid not null constraints");
pg_log_info("finding invalid not-null constraints");

resetPQExpBuffer(q);
appendPQExpBuffer(q,
Expand Down Expand Up @@ -10855,7 +10855,7 @@ dumpRelationStats_dumper(Archive *fout, const void *userArg, const TocEntry *te)
expected_te = expected_te->next;

if (te != expected_te)
pg_fatal("stats dumped out of order (current: %d %s %s) (expected: %d %s %s)",
pg_fatal("statistics dumped out of order (current: %d %s %s, expected: %d %s %s)",
te->dumpId, te->desc, te->tag,
expected_te->dumpId, expected_te->desc, expected_te->tag);

Expand Down Expand Up @@ -10996,7 +10996,7 @@ dumpRelationStats_dumper(Archive *fout, const void *userArg, const TocEntry *te)
appendStringLiteralAH(out, rsinfo->dobj.name, fout);

if (PQgetisnull(res, rownum, i_attname))
pg_fatal("attname cannot be NULL");
pg_fatal("unexpected null attname");
attname = PQgetvalue(res, rownum, i_attname);

/*
Expand Down
8 changes: 4 additions & 4 deletions src/bin/pg_dump/pg_dumpall.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ main(int argc, char *argv[])

OPF = fopen(global_path, PG_BINARY_W);
if (!OPF)
pg_fatal("could not open \"%s\": %m", global_path);
pg_fatal("could not open file \"%s\": %m", global_path);
}
else if (filename)
{
Expand Down Expand Up @@ -1659,14 +1659,14 @@ dumpDatabases(PGconn *conn, ArchiveFormat archDumpFormat)

/* Create a subdirectory with 'databases' name under main directory. */
if (mkdir(db_subdir, pg_dir_create_mode) != 0)
pg_fatal("could not create subdirectory \"%s\": %m", db_subdir);
pg_fatal("could not create directory \"%s\": %m", db_subdir);

snprintf(map_file_path, MAXPGPATH, "%s/map.dat", filename);

/* Create a map file (to store dboid and dbname) */
map_file = fopen(map_file_path, PG_BINARY_W);
if (!map_file)
pg_fatal("could not open map file: %s", strerror(errno));
pg_fatal("could not open file \"%s\": %m", map_file_path);
}

for (i = 0; i < PQntuples(res); i++)
Expand Down Expand Up @@ -1976,7 +1976,7 @@ parseDumpFormat(const char *format)
else if (pg_strcasecmp(format, "tar") == 0)
archDumpFormat = archTar;
else
pg_fatal("unrecognized archive format \"%s\"; please specify \"c\", \"d\", \"p\", or \"t\"",
pg_fatal("unrecognized output format \"%s\"; please specify \"c\", \"d\", \"p\", or \"t\"",
format);

return archDumpFormat;
Expand Down
43 changes: 25 additions & 18 deletions src/bin/pg_dump/pg_restore.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ main(int argc, char **argv)
*/
if (!globals_only && opts->createDB != 1)
{
pg_log_error("-C/--create option should be specified when restoring an archive created by pg_dumpall");
pg_log_error("option -C/--create must be specified when restoring an archive created by pg_dumpall");
pg_log_error_hint("Try \"%s --help\" for more information.", progname);
pg_log_error_hint("Individual databases can be restored using their specific archives.");
exit_nicely(1);
Expand Down Expand Up @@ -557,7 +557,7 @@ main(int argc, char **argv)
if (conn)
PQfinish(conn);

pg_log_info("database restoring skipped as -g/--globals-only option was specified");
pg_log_info("database restoring skipped because option -g/--globals-only was specified");
}
else
{
Expand Down Expand Up @@ -725,8 +725,8 @@ usage(const char *progname)
printf(_(" --role=ROLENAME do SET ROLE before restore\n"));

printf(_("\n"
"The options -I, -n, -N, -P, -t, -T, --section, and --exclude-database can be combined\n"
"and specified multiple times to select multiple objects.\n"));
"The options -I, -n, -N, -P, -t, -T, --section, and --exclude-database can be\n"
"combined and specified multiple times to select multiple objects.\n"));
printf(_("\nIf no input file name is supplied, then standard input is used.\n\n"));
printf(_("Report bugs to <%s>.\n"), PACKAGE_BUGREPORT);
printf(_("%s home page: <%s>\n"), PACKAGE_NAME, PACKAGE_URL);
Expand Down Expand Up @@ -946,7 +946,7 @@ get_dbnames_list_to_restore(PGconn *conn,
query = createPQExpBuffer();

if (!conn)
pg_log_info("considering PATTERN as NAME for --exclude-database option as no db connection while doing pg_restore.");
pg_log_info("considering PATTERN as NAME for --exclude-database option as no database connection while doing pg_restore");

/*
* Process one by one all dbnames and if specified to skip restoring, then
Expand Down Expand Up @@ -992,7 +992,7 @@ get_dbnames_list_to_restore(PGconn *conn,
if ((PQresultStatus(res) == PGRES_TUPLES_OK) && PQntuples(res))
{
skip_db_restore = true;
pg_log_info("database \"%s\" matches exclude pattern: \"%s\"", dbidname->str, pat_cell->val);
pg_log_info("database name \"%s\" matches exclude pattern \"%s\"", dbidname->str, pat_cell->val);
}

PQclear(res);
Expand Down Expand Up @@ -1048,7 +1048,7 @@ get_dbname_oid_list_from_mfile(const char *dumpdirpath, SimplePtrList *dbname_oi
*/
if (!file_exists_in_directory(dumpdirpath, "map.dat"))
{
pg_log_info("database restoring is skipped as \"map.dat\" is not present in \"%s\"", dumpdirpath);
pg_log_info("database restoring is skipped because file \"%s\" does not exist in directory \"%s\"", "map.dat", dumpdirpath);
return 0;
}

Expand All @@ -1058,7 +1058,7 @@ get_dbname_oid_list_from_mfile(const char *dumpdirpath, SimplePtrList *dbname_oi
pfile = fopen(map_file_path, PG_BINARY_R);

if (pfile == NULL)
pg_fatal("could not open \"%s\": %m", map_file_path);
pg_fatal("could not open file \"%s\": %m", map_file_path);

initStringInfo(&linebuf);

Expand Down Expand Up @@ -1086,10 +1086,10 @@ get_dbname_oid_list_from_mfile(const char *dumpdirpath, SimplePtrList *dbname_oi

/* Report error and exit if the file has any corrupted data. */
if (!OidIsValid(db_oid) || namelen <= 1)
pg_fatal("invalid entry in \"%s\" at line: %d", map_file_path,
pg_fatal("invalid entry in file \"%s\" on line %d", map_file_path,
count + 1);

pg_log_info("found database \"%s\" (OID: %u) in \"%s\"",
pg_log_info("found database \"%s\" (OID: %u) in file \"%s\"",
dbname, db_oid, map_file_path);

dbidname = pg_malloc(offsetof(DbOidName, str) + namelen + 1);
Expand Down Expand Up @@ -1142,11 +1142,14 @@ restore_all_databases(PGconn *conn, const char *dumpdirpath,
if (dbname_oid_list.head == NULL)
return process_global_sql_commands(conn, dumpdirpath, opts->filename);

pg_log_info("found %d database names in \"map.dat\"", num_total_db);
pg_log_info(ngettext("found %d database name in \"%s\"",
"found %d database names in \"%s\"",
num_total_db),
num_total_db, "map.dat");

if (!conn)
{
pg_log_info("trying to connect database \"postgres\"");
pg_log_info("trying to connect to database \"%s\"", "postgres");

conn = ConnectDatabase("postgres", NULL, opts->cparams.pghost,
opts->cparams.pgport, opts->cparams.username, TRI_DEFAULT,
Expand All @@ -1155,7 +1158,7 @@ restore_all_databases(PGconn *conn, const char *dumpdirpath,
/* Try with template1. */
if (!conn)
{
pg_log_info("trying to connect database \"template1\"");
pg_log_info("trying to connect to database \"%s\"", "template1");

conn = ConnectDatabase("template1", NULL, opts->cparams.pghost,
opts->cparams.pgport, opts->cparams.username, TRI_DEFAULT,
Expand All @@ -1179,7 +1182,9 @@ restore_all_databases(PGconn *conn, const char *dumpdirpath,
/* Exit if no db needs to be restored. */
if (dbname_oid_list.head == NULL || num_db_restore == 0)
{
pg_log_info("no database needs to restore out of %d databases", num_total_db);
pg_log_info(ngettext("no database needs restoring out of %d database",
"no database needs restoring out of %d databases", num_total_db),
num_total_db);
return n_errors_total;
}

Expand Down Expand Up @@ -1314,7 +1319,7 @@ process_global_sql_commands(PGconn *conn, const char *dumpdirpath, const char *o
pfile = fopen(global_file_path, PG_BINARY_R);

if (pfile == NULL)
pg_fatal("could not open \"%s\": %m", global_file_path);
pg_fatal("could not open file \"%s\": %m", global_file_path);

/*
* If outfile is given, then just copy all global.dat file data into
Expand Down Expand Up @@ -1354,15 +1359,17 @@ process_global_sql_commands(PGconn *conn, const char *dumpdirpath, const char *o
break;
default:
n_errors++;
pg_log_error("could not execute query: \"%s\" \nCommand was: \"%s\"", PQerrorMessage(conn), sqlstatement.data);
pg_log_error("could not execute query: %s", PQerrorMessage(conn));
pg_log_error_detail("Command was: %s", sqlstatement.data);
}
PQclear(result);
}

/* Print a summary of ignored errors during global.dat. */
if (n_errors)
pg_log_warning("ignored %d errors in \"%s\"", n_errors, global_file_path);

pg_log_warning(ngettext("ignored %d error in file \"%s\"",
"ignored %d errors in file \"%s\"", n_errors),
n_errors, global_file_path);
fclose(pfile);

return n_errors;
Expand Down
4 changes: 2 additions & 2 deletions src/bin/pg_dump/t/001_basic.pl
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,6 @@

command_fails_like(
[ 'pg_dumpall', '--format', 'x' ],
qr/\Qpg_dumpall: error: unrecognized archive format "x";\E/,
'pg_dumpall: unrecognized archive format');
qr/\Qpg_dumpall: error: unrecognized output format "x";\E/,
'pg_dumpall: unrecognized output format');
done_testing();
2 changes: 1 addition & 1 deletion src/bin/pg_dump/t/006_pg_dumpall.pl
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@
"$tempdir/format_custom",
'--format' => 'custom',
'--file' => "$tempdir/error_test.sql", ],
qr/\Qpg_restore: error: -C\/--create option should be specified when restoring an archive created by pg_dumpall\E/,
qr/\Qpg_restore: error: option -C\/--create must be specified when restoring an archive created by pg_dumpall\E/,
'When -C is not used in pg_restore with dump of pg_dumpall');

# test case 2: When --list option is used with dump of pg_dumpall
Expand Down
Loading