pg.ddx.io pgsql-committers@postgresql.org mailing list archive
help / color / mirror / Atom feedpsqlodbc - psqlodbc: Fix an infinite loop in utf8_to_ucs2().
4+ messages / 3 participants
[nested] [flat]
Commits from this thread:
2024-03-26 8c4f2d5475 Message fixes for pg_createsubscriber
* psqlodbc - psqlodbc: Fix an infinite loop in utf8_to_ucs2().
@ 2009-04-04 14:55 User Hinoue <hinoue@pgfoundry.org>
0 siblings, 0 replies; 4+ messages in thread
From: hinoue@pgfoundry.org @ 2009-04-04 14:55 UTC (permalink / raw)
To: pgsql-committers
Log Message:
-----------
Fix an infinite loop in utf8_to_ucs2().
Modified Files:
--------------
psqlodbc:
version.h (r1.136 -> r1.137)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/psqlodbc/psqlodbc/version.h.diff?r1=1.136&r2=1.137)
win_unicode.c (r1.22 -> r1.23)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/psqlodbc/psqlodbc/win_unicode.c.diff?r1=1.22&r2=1.23)
^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: pg_createsubscriber: creates a new logical replica from a standb
@ 2024-03-25 11:48 Peter Eisentraut <peter@eisentraut.org>
0 siblings, 1 reply; 4+ messages in thread
From: Peter Eisentraut @ 2024-03-25 11:48 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
pg_createsubscriber: creates a new logical replica from a standby server
It must be run on the target server and should be able to connect to
the source server (publisher) and the target server (subscriber). All
tables in the specified database(s) are included in the logical
replication setup. A pair of publication and subscription objects are
created for each database.
The main advantage of pg_createsubscriber over the common logical
replication setup is the initial data copy. It also reduces the
catchup phase.
Some prerequisites must be met to successfully run it. It is
basically the logical replication requirements. It starts creating a
publication using FOR ALL TABLES and a replication slot for each
specified database. Write recovery parameters into the target data
directory and start the target server. It specifies the LSN of the
last replication slot (replication start point) up to which the
recovery will proceed. Wait until the target server is promoted.
Create one subscription per specified database (using publication and
replication slot created in a previous step) on the target server.
Set the replication progress to the replication start point for each
subscription. Enable the subscription for each specified database on
the target server. And finally, change the system identifier on the
target server.
Author: Euler Taveira <euler.taveira@enterprisedb.com>
Reviewed-by: Hayato Kuroda <kuroda.hayato@fujitsu.com>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Reviewed-by: Shlok Kyal <shlok.kyal.oss@gmail.com>
Reviewed-by: Vignesh C <vignesh21@gmail.com>
Reviewed-by: Shubham Khanna <khannashubham1197@gmail.com>
Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://www.postgresql.org/message-id/flat/5ac50071-f2ed-4ace-a8fd-b892cffd33eb@www.fastmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/d44032d0146306971cd5ccf232fe37269717d6f2
Modified Files
--------------
doc/src/sgml/ref/allfiles.sgml | 1 +
doc/src/sgml/ref/pg_createsubscriber.sgml | 523 +++++
doc/src/sgml/reference.sgml | 1 +
src/bin/pg_basebackup/.gitignore | 1 +
src/bin/pg_basebackup/Makefile | 11 +-
src/bin/pg_basebackup/meson.build | 19 +
src/bin/pg_basebackup/nls.mk | 1 +
src/bin/pg_basebackup/pg_createsubscriber.c | 2141 ++++++++++++++++++++
src/bin/pg_basebackup/t/040_pg_createsubscriber.pl | 364 ++++
9 files changed, 3059 insertions(+), 3 deletions(-)
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: pgsql: pg_createsubscriber: creates a new logical replica from a standb
@ 2024-03-26 05:01 Kyotaro Horiguchi <horikyota.ntt@gmail.com>
parent: Peter Eisentraut <peter@eisentraut.org>
0 siblings, 1 reply; 4+ messages in thread
From: Kyotaro Horiguchi @ 2024-03-26 05:01 UTC (permalink / raw)
To: peter@eisentraut.org; +Cc: pgsql-committers@lists.postgresql.org
Hello.
This commit added the following error message:
pg_createsubscriber.c: 375
> pg_fatal("could not access directory \"%s\": %s", datadir,
> strerror(errno));
Although other messages use %s with PQresultErrorMessage(), regarding
this specific message, shouldn't we use %m instead of %s + strerror()?
I'm not sure if that would be better.
pg_createsubscriber.c: 687
> pg_log_error("could not obtain database OID: got %d rows, expected %d rows",
> PQntuples(res), 1);
pg_createsubscriber.c: 1652
> pg_log_error("could not obtain subscription OID: got %d rows, expected %d rows",
In these messages, the second %d is always written as "1 rows",
whereas a similar message correctly uses "1 row".
pg_createsubscriber.c: 561
> pg_log_error("could not get system identifier: got %d rows, expected %d row",
> PQntuples(res), 1);
I think it would be better to change the former instances to "%d row",
or to change both to "1 row". I'd like to go the second way but maybe
we should take the first way following our convention.
pg_createsubscriber.c: 923
> pg_log_error("publisher requires wal_level >= logical");
We discussed this message in relation to commit 801792e528, and
decided to quote "logical" to clarify that it is a string literal. I'd
like to follow the conclusion here, too.
regards.
--
Kyotaro Horiguchi
NTT Open Source Software Center
Attachments:
pg_createsubscriber_message_fixes_v1.patch (text/x-patch, 1.5K) download
diff --git a/src/bin/pg_basebackup/pg_createsubscriber.c b/src/bin/pg_basebackup/pg_createsubscriber.c
index b8f8269340..a6e0986670 100644
--- a/src/bin/pg_basebackup/pg_createsubscriber.c
+++ b/src/bin/pg_basebackup/pg_createsubscriber.c
@@ -372,8 +372,7 @@ check_data_directory(const char *datadir)
if (errno == ENOENT)
pg_fatal("data directory \"%s\" does not exist", datadir);
else
- pg_fatal("could not access directory \"%s\": %s", datadir,
- strerror(errno));
+ pg_fatal("could not access directory \"%s\": %m", datadir);
}
snprintf(versionfile, MAXPGPATH, "%s/PG_VERSION", datadir);
@@ -684,7 +683,7 @@ generate_object_name(PGconn *conn)
if (PQntuples(res) != 1)
{
- pg_log_error("could not obtain database OID: got %d rows, expected %d rows",
+ pg_log_error("could not obtain database OID: got %d rows, expected %d row",
PQntuples(res), 1);
disconnect_database(conn, true);
}
@@ -920,7 +919,7 @@ check_publisher(const struct LogicalRepInfo *dbinfo)
if (strcmp(wal_level, "logical") != 0)
{
- pg_log_error("publisher requires wal_level >= logical");
+ pg_log_error("publisher requires wal_level >= \"logical\"");
failed = true;
}
@@ -1649,7 +1648,7 @@ set_replication_progress(PGconn *conn, const struct LogicalRepInfo *dbinfo, cons
if (PQntuples(res) != 1 && !dry_run)
{
- pg_log_error("could not obtain subscription OID: got %d rows, expected %d rows",
+ pg_log_error("could not obtain subscription OID: got %d rows, expected %d row",
PQntuples(res), 1);
disconnect_database(conn, true);
}
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: pgsql: pg_createsubscriber: creates a new logical replica from a standb
@ 2024-03-26 07:30 Peter Eisentraut <peter@eisentraut.org>
parent: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
0 siblings, 0 replies; 4+ messages in thread
From: Peter Eisentraut @ 2024-03-26 07:30 UTC (permalink / raw)
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>; +Cc: pgsql-committers@lists.postgresql.org
I have committed your patch to tidy this up. Thanks.
On 26.03.24 06:01, Kyotaro Horiguchi wrote:
> Hello.
>
> This commit added the following error message:
>
> pg_createsubscriber.c: 375
>> pg_fatal("could not access directory \"%s\": %s", datadir,
>> strerror(errno));
>
> Although other messages use %s with PQresultErrorMessage(), regarding
> this specific message, shouldn't we use %m instead of %s + strerror()?
> I'm not sure if that would be better.
>
>
> pg_createsubscriber.c: 687
>> pg_log_error("could not obtain database OID: got %d rows, expected %d rows",
>> PQntuples(res), 1);
> pg_createsubscriber.c: 1652
>> pg_log_error("could not obtain subscription OID: got %d rows, expected %d rows",
>
> In these messages, the second %d is always written as "1 rows",
> whereas a similar message correctly uses "1 row".
>
> pg_createsubscriber.c: 561
>> pg_log_error("could not get system identifier: got %d rows, expected %d row",
>> PQntuples(res), 1);
>
> I think it would be better to change the former instances to "%d row",
> or to change both to "1 row". I'd like to go the second way but maybe
> we should take the first way following our convention.
>
>
> pg_createsubscriber.c: 923
>> pg_log_error("publisher requires wal_level >= logical");
>
> We discussed this message in relation to commit 801792e528, and
> decided to quote "logical" to clarify that it is a string literal. I'd
> like to follow the conclusion here, too.
>
> regards.
>
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2024-03-26 07:30 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2009-04-04 14:55 psqlodbc - psqlodbc: Fix an infinite loop in utf8_to_ucs2(). User Hinoue <hinoue@pgfoundry.org>
2024-03-25 11:48 pgsql: pg_createsubscriber: creates a new logical replica from a standb Peter Eisentraut <peter@eisentraut.org>
2024-03-26 05:01 ` Re: pgsql: pg_createsubscriber: creates a new logical replica from a standb Kyotaro Horiguchi <horikyota.ntt@gmail.com>
2024-03-26 07:30 ` Re: pgsql: pg_createsubscriber: creates a new logical replica from a standb Peter Eisentraut <peter@eisentraut.org>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox