Various cosmetic fixes
Started by Euler Taveiraover 11 years ago2 messages
Hi,
While updating pt-br translation I noticed that some sentences could be
improved. I also fix some style glitches. A set of patches are attached.
--
Euler Taveira Timbira - http://www.timbira.com.br/
PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento
Attachments:
0001-Fix-style.patchtext/x-patch; name=0001-Fix-style.patchDownload
>From 87a499cd8fe6a1d0c491b3263c3daf66856cf6f1 Mon Sep 17 00:00:00 2001
From: Euler Taveira <euler@timbira.com>
Date: Wed, 14 May 2014 14:17:00 -0300
Subject: [PATCH 01/11] Fix style.
Use the same messages from pg_receivexlog because they were copied from
it.
---
src/bin/pg_basebackup/pg_recvlogical.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/bin/pg_basebackup/pg_recvlogical.c b/src/bin/pg_basebackup/pg_recvlogical.c
index 194d10f..52dc839 100644
--- a/src/bin/pg_basebackup/pg_recvlogical.c
+++ b/src/bin/pg_basebackup/pg_recvlogical.c
@@ -965,14 +965,14 @@ main(int argc, char **argv)
}
else if (noloop)
{
- fprintf(stderr, _("%s: disconnected.\n"), progname);
+ fprintf(stderr, _("%s: disconnected\n"), progname);
exit(1);
}
else
{
fprintf(stderr,
/* translator: check source for value for %d */
- _("%s: disconnected. Waiting %d seconds to try again.\n"),
+ _("%s: disconnected; waiting %d seconds to try again\n"),
progname, RECONNECT_SLEEP_TIME);
pg_usleep(RECONNECT_SLEEP_TIME * 1000000);
}
--
2.0.0.rc0
0002-Don-t-hardwire-default-values.patchtext/x-patch; name=0002-Don-t-hardwire-default-values.patchDownload
>From 864aabd419ce3f4ae5afcf751ebeb22eb9f0e257 Mon Sep 17 00:00:00 2001
From: Euler Taveira <euler@timbira.com>
Date: Wed, 14 May 2014 14:18:53 -0300
Subject: [PATCH 02/11] Don't hardwire default values.
Avoid hardwiring default values in help. Also, provide the unit
(seconds) in the parameter value (following style elsewhere).
---
src/bin/pg_basebackup/pg_recvlogical.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/bin/pg_basebackup/pg_recvlogical.c b/src/bin/pg_basebackup/pg_recvlogical.c
index 52dc839..e7d2e97 100644
--- a/src/bin/pg_basebackup/pg_recvlogical.c
+++ b/src/bin/pg_basebackup/pg_recvlogical.c
@@ -80,14 +80,14 @@ usage(void)
printf(_(" -w, --no-password never prompt for password\n"));
printf(_(" -W, --password force password prompt (should happen automatically)\n"));
printf(_("\nReplication options:\n"));
- printf(_(" -F --fsync-interval=INTERVAL\n"
- " frequency of syncs to the output file (in seconds, defaults to 10)\n"));
+ printf(_(" -F --fsync-interval=SECS\n"
+ " frequency of syncs to the output file (default: %d)\n"), (fsync_interval / 1000));
printf(_(" -o, --option=NAME[=VALUE]\n"
" Specify option NAME with optional value VALUE, to be passed\n"
" to the output plugin\n"));
- printf(_(" -P, --plugin=PLUGIN use output plugin PLUGIN (defaults to test_decoding)\n"));
- printf(_(" -s, --status-interval=INTERVAL\n"
- " time between status packets sent to server (in seconds, defaults to 10)\n"));
+ printf(_(" -P, --plugin=PLUGIN use output plugin PLUGIN (default: %s)\n"), plugin);
+ printf(_(" -s, --status-interval=SECS\n"
+ " time between status packets sent to server (default: %d)\n"), (standby_message_timeout / 1000));
printf(_(" -S, --slot=SLOT use existing replication slot SLOT instead of starting a new one\n"));
printf(_(" -I, --startpos=PTR Where in an existing slot should the streaming start\n"));
printf(_("\nAction to be performed:\n"));
--
2.0.0.rc0
0003-Fix-typo.patchtext/x-patch; name=0003-Fix-typo.patchDownload
>From fc089e4946e2c8780eae34ac08d9b6839470e8b4 Mon Sep 17 00:00:00 2001
From: Euler Taveira <euler@timbira.com>
Date: Wed, 14 May 2014 14:20:44 -0300
Subject: [PATCH 03/11] Fix typo.
s/pg_receivexlog/pg_recvlogical/
---
doc/src/sgml/ref/pg_recvlogical.sgml | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/doc/src/sgml/ref/pg_recvlogical.sgml b/doc/src/sgml/ref/pg_recvlogical.sgml
index 4170c8e..edc52c0 100644
--- a/doc/src/sgml/ref/pg_recvlogical.sgml
+++ b/doc/src/sgml/ref/pg_recvlogical.sgml
@@ -226,13 +226,12 @@ PostgreSQL documentation
<term><option>--fsync-interval=<replaceable>interval_seconds</replaceable></option></term>
<listitem>
<para>
- How often should
- <link linkend="app-pgreceivexlog"><application>pg_receivexlog</application></link>
- issue sync commands to ensure the <parameter>--outputfile</parameter>
- is safely flushed to disk without being asked by the server to do
- so. Specifying an interval of <literal>0</literal> disables issuing
- fsyncs altogether, while still reporting progress the server.
- In this case, data may be lost in the event of a crash.
+ How often should <application>pg_recvlogical</application> issue sync
+ commands to ensure the <parameter>--outputfile</parameter> is safely
+ flushed to disk without being asked by the server to do so. Specifying
+ an interval of <literal>0</literal> disables issuing fsyncs altogether,
+ while still reporting progress the server. In this case, data may be
+ lost in the event of a crash.
</para>
</listitem>
</varlistentry>
--
2.0.0.rc0
0004-Rephrase-some-sentences.patchtext/x-patch; name=0004-Rephrase-some-sentences.patchDownload
>From 068eedaef58f174de81589de2e50bcafde39dd46 Mon Sep 17 00:00:00 2001
From: Euler Taveira <euler@timbira.com>
Date: Wed, 14 May 2014 14:21:59 -0300
Subject: [PATCH 04/11] Rephrase some sentences.
The style is used in another backend messages.
---
src/bin/pg_basebackup/pg_recvlogical.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/bin/pg_basebackup/pg_recvlogical.c b/src/bin/pg_basebackup/pg_recvlogical.c
index e7d2e97..93db97f 100644
--- a/src/bin/pg_basebackup/pg_recvlogical.c
+++ b/src/bin/pg_basebackup/pg_recvlogical.c
@@ -817,7 +817,7 @@ main(int argc, char **argv)
if (do_drop_slot && (do_create_slot || do_start_slot))
{
- fprintf(stderr, _("%s: --stop cannot be combined with --init or --start\n"), progname);
+ fprintf(stderr, _("%s: cannot use --init or --start together with --stop\n"), progname);
fprintf(stderr, _("Try \"%s --help\" for more information.\n"),
progname);
exit(1);
@@ -825,7 +825,7 @@ main(int argc, char **argv)
if (startpos && (do_create_slot || do_drop_slot))
{
- fprintf(stderr, _("%s: --startpos cannot be combined with --init or --stop\n"), progname);
+ fprintf(stderr, _("%s: cannot use --init or --stop together with --startpos\n"), progname);
fprintf(stderr, _("Try \"%s --help\" for more information.\n"),
progname);
exit(1);
--
2.0.0.rc0
0005-Rephrase-another-sentence.patchtext/x-patch; name=0005-Rephrase-another-sentence.patchDownload
>From 565a1abb3c7eace4c60bb9726189faac7484596e Mon Sep 17 00:00:00 2001
From: Euler Taveira <euler@timbira.com>
Date: Wed, 14 May 2014 14:23:30 -0300
Subject: [PATCH 05/11] Rephrase another sentence.
Use active voice.
---
src/bin/pg_basebackup/pg_recvlogical.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/bin/pg_basebackup/pg_recvlogical.c b/src/bin/pg_basebackup/pg_recvlogical.c
index 93db97f..a23381f 100644
--- a/src/bin/pg_basebackup/pg_recvlogical.c
+++ b/src/bin/pg_basebackup/pg_recvlogical.c
@@ -263,7 +263,7 @@ StreamLog(void)
if (verbose)
fprintf(stderr,
- _("%s: initiated streaming\n"),
+ _("%s: streaming initiated\n"),
progname);
while (!time_to_abort)
--
2.0.0.rc0
0006-Rephrase-some-sentences.patchtext/x-patch; name=0006-Rephrase-some-sentences.patchDownload
>From b2eeb33feec26957641450f8042ff6f49ea3ac74 Mon Sep 17 00:00:00 2001
From: Euler Taveira <euler@timbira.com>
Date: Wed, 14 May 2014 14:27:38 -0300
Subject: [PATCH 06/11] Rephrase some sentences.
The style is used in backend messages.
---
src/bin/pg_basebackup/pg_basebackup.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c
index 154c52d..7d2f119 100644
--- a/src/bin/pg_basebackup/pg_basebackup.c
+++ b/src/bin/pg_basebackup/pg_basebackup.c
@@ -187,14 +187,14 @@ tablespace_list_append(const char *arg)
*/
if (!is_absolute_path(cell->old_dir))
{
- fprintf(stderr, _("%s: old directory not absolute in tablespace mapping: %s\n"),
+ fprintf(stderr, _("%s: old directory is not an absolute path in tablespace mapping: %s\n"),
progname, cell->old_dir);
exit(1);
}
if (!is_absolute_path(cell->new_dir))
{
- fprintf(stderr, _("%s: new directory not absolute in tablespace mapping: %s\n"),
+ fprintf(stderr, _("%s: new directory is not an absolute path in tablespace mapping: %s\n"),
progname, cell->new_dir);
exit(1);
}
--
2.0.0.rc0
0007-Small-typo.patchtext/x-patch; name=0007-Small-typo.patchDownload
>From 4871e34bf5a9305281e853335c4ac2e54c351778 Mon Sep 17 00:00:00 2001
From: Euler Taveira <euler@timbira.com>
Date: Wed, 14 May 2014 14:29:15 -0300
Subject: [PATCH 07/11] Small typo.
Singular form for one unit.
---
src/bin/pg_basebackup/pg_basebackup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c
index 7d2f119..b119fc0 100644
--- a/src/bin/pg_basebackup/pg_basebackup.c
+++ b/src/bin/pg_basebackup/pg_basebackup.c
@@ -676,7 +676,7 @@ parse_max_rate(char *src)
if (*after_num != '\0')
{
fprintf(stderr,
- _("%s: invalid --max-rate units: \"%s\"\n"),
+ _("%s: invalid --max-rate unit: \"%s\"\n"),
progname, suffix);
exit(1);
}
--
2.0.0.rc0
0008-Remove-trailing-newline.patchtext/x-patch; name=0008-Remove-trailing-newline.patchDownload
>From 42130f7272355749d86490d5d1a192ab0b8de999 Mon Sep 17 00:00:00 2001
From: Euler Taveira <euler@timbira.com>
Date: Wed, 14 May 2014 14:31:11 -0300
Subject: [PATCH 08/11] Remove trailing newline.
PQresultErrorMessage() includes a trailing newline.
---
src/bin/pg_basebackup/pg_recvlogical.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/bin/pg_basebackup/pg_recvlogical.c b/src/bin/pg_basebackup/pg_recvlogical.c
index a23381f..0679cd4 100644
--- a/src/bin/pg_basebackup/pg_recvlogical.c
+++ b/src/bin/pg_basebackup/pg_recvlogical.c
@@ -253,7 +253,7 @@ StreamLog(void)
res = PQexec(conn, query->data);
if (PQresultStatus(res) != PGRES_COPY_BOTH)
{
- fprintf(stderr, _("%s: could not send replication command \"%s\": %s\n"),
+ fprintf(stderr, _("%s: could not send replication command \"%s\": %s"),
progname, query->data, PQresultErrorMessage(res));
PQclear(res);
goto error;
--
2.0.0.rc0
0009-Don-t-use-abbreviation.patchtext/x-patch; name=0009-Don-t-use-abbreviation.patchDownload
>From 594689e04208a30205c134330e88486274780591 Mon Sep 17 00:00:00 2001
From: Euler Taveira <euler@timbira.com>
Date: Wed, 14 May 2014 14:31:47 -0300
Subject: [PATCH 09/11] Don't use abbreviation.
---
src/bin/pg_basebackup/pg_recvlogical.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/bin/pg_basebackup/pg_recvlogical.c b/src/bin/pg_basebackup/pg_recvlogical.c
index 0679cd4..2bd1ad4 100644
--- a/src/bin/pg_basebackup/pg_recvlogical.c
+++ b/src/bin/pg_basebackup/pg_recvlogical.c
@@ -895,7 +895,7 @@ main(int argc, char **argv)
if (PQntuples(res) != 0 || PQnfields(res) != 0)
{
fprintf(stderr,
- _("%s: could not stop logical rep: got %d rows and %d fields, expected %d rows and %d fields\n"),
+ _("%s: could not stop logical replication: got %d rows and %d fields, expected %d rows and %d fields\n"),
progname, PQntuples(res), PQnfields(res), 0, 0);
disconnect_and_exit(1);
}
@@ -930,7 +930,7 @@ main(int argc, char **argv)
if (PQntuples(res) != 1 || PQnfields(res) != 4)
{
fprintf(stderr,
- _("%s: could not init logical rep: got %d rows and %d fields, expected %d rows and %d fields\n"),
+ _("%s: could not init logical replication: got %d rows and %d fields, expected %d rows and %d fields\n"),
progname, PQntuples(res), PQnfields(res), 1, 4);
disconnect_and_exit(1);
}
--
2.0.0.rc0
0010-Fix-style.patchtext/x-patch; name=0010-Fix-style.patchDownload
>From d5b7e95e02a63b3375a76270f79170a19f8ea789 Mon Sep 17 00:00:00 2001
From: Euler Taveira <euler@timbira.com>
Date: Wed, 14 May 2014 14:32:34 -0300
Subject: [PATCH 10/11] Fix style.
Put 'pager' parameter in its correct position (after the description).
Also, use plural form for HTML attributes (it can contain more than one
attribute).
---
src/bin/psql/command.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index e49cf44..cede72a 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -2552,7 +2552,7 @@ printPsetInfo(const char *param, struct printQueryOpt *popt)
else if (popt->topt.pager == 2)
printf(_("Pager (%s) is always used.\n"), param);
else
- printf(_("Pager (%s) usage is off.\n"), param);
+ printf(_("Pager usage (%s) is off.\n"), param);
}
/* show record separator for unaligned text */
@@ -2576,7 +2576,7 @@ printPsetInfo(const char *param, struct printQueryOpt *popt)
else if (strcmp(param, "T") == 0 || strcmp(param, "tableattr") == 0)
{
if (popt->topt.tableAttr)
- printf(_("Table attribute (%s) is \"%s\".\n"), param,
+ printf(_("Table attributes (%s) are \"%s\".\n"), param,
popt->topt.tableAttr);
else
printf(_("Table attributes (%s) unset.\n"), param);
--
2.0.0.rc0
0011-Fix-style.patchtext/x-patch; name=0011-Fix-style.patchDownload
>From 4ce7d422ed6fbab56cde7d6611cca80d711ac679 Mon Sep 17 00:00:00 2001
From: Euler Taveira <euler@timbira.com>
Date: Wed, 14 May 2014 14:33:29 -0300
Subject: [PATCH 11/11] Fix style.
---
src/backend/replication/libpqwalreceiver/libpqwalreceiver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
index 7bc761d..65e95c5 100644
--- a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
+++ b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
@@ -139,7 +139,7 @@ libpqrcv_identify_system(TimeLineID *primary_tli)
PQclear(res);
ereport(ERROR,
(errmsg("invalid response from primary server"),
- errdetail("Could not identify system: Got %d rows and %d fields, expected %d rows and %d or more fields.",
+ errdetail("Could not identify system: got %d rows and %d fields, expected %d rows and %d or more fields.",
ntuples, nfields, 3, 1)));
}
primary_sysid = PQgetvalue(res, 0, 0);
--
2.0.0.rc0
Re: Various cosmetic fixes
On 05/14/2014 08:49 PM, Euler Taveira wrote:
While updating pt-br translation I noticed that some sentences could be
improved. I also fix some style glitches. A set of patches are attached.
Thanks, applied.
- Heikki
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers