pg.ddx.io pgsql-committers@postgresql.org mailing list archive
help / color / mirror / Atom feedpgsql: Preventive maintenance in advance of pgindent run.
22+ messages / 6 participants
[nested] [flat]
* pgsql: Preventive maintenance in advance of pgindent run.
@ 2017-05-17 00:36 Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:08 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
0 siblings, 1 reply; 22+ messages in thread
From: Tom Lane @ 2017-05-17 00:36 UTC (permalink / raw)
To: pgsql-committers
Preventive maintenance in advance of pgindent run.
Reformat various places in which pgindent will make a mess, and
fix a few small violations of coding style that I happened to notice
while perusing the diffs from a pgindent dry run.
There is one actual bug fix here: the need-to-enlarge-the-buffer code
path in icu_convert_case was obviously broken. Perhaps it's unreachable
in our usage? Or maybe this is just sadly undertested.
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/c079673dcb7f210617c9fc1470e6bf166d8a2971
Modified Files
--------------
contrib/btree_gist/btree_utils_num.c | 11 +++++---
src/backend/catalog/pg_publication.c | 11 ++++----
src/backend/commands/publicationcmds.c | 4 ++-
src/backend/commands/subscriptioncmds.c | 1 +
src/backend/executor/nodeNamedtuplestorescan.c | 1 +
src/backend/replication/logical/snapbuild.c | 2 +-
src/backend/replication/pgoutput/pgoutput.c | 5 ++--
src/backend/tsearch/wparser.c | 13 ++++++----
src/backend/utils/adt/formatting.c | 35 ++++++++++++++++++--------
src/backend/utils/adt/pg_locale.c | 2 ++
src/bin/pg_basebackup/pg_basebackup.c | 24 +++++++++---------
src/bin/pg_dump/dumputils.c | 3 +--
src/bin/pg_dump/pg_backup_archiver.h | 4 +--
src/bin/pg_waldump/pg_waldump.c | 18 ++++++-------
src/bin/psql/tab-complete.c | 7 +++---
src/common/scram-common.c | 3 ++-
src/include/catalog/pg_authid.h | 16 ++++++------
src/include/catalog/pg_subscription_rel.h | 14 +++++------
src/include/replication/logicalproto.h | 6 +++--
src/interfaces/libpq/libpq-int.h | 4 +--
20 files changed, 105 insertions(+), 79 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run.
2017-05-17 00:36 pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
@ 2017-05-17 14:08 ` Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 14:14 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 22+ messages in thread
From: Alvaro Herrera @ 2017-05-17 14:08 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-hackers@postgresql.org
Tom Lane wrote:
> src/bin/pg_basebackup/pg_basebackup.c | 24 +++++++++---------
> src/bin/pg_waldump/pg_waldump.c | 18 ++++++-------
There are some changes here that should be reverted; for instance:
- printf(_(" -c, --checkpoint=fast|spread\n"
- " set fast or spread checkpointing\n"));
+ printf(_(" -c, --checkpoint=fast|spread\n"));
+ printf(_(" set fast or spread checkpointing\n"));
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run.
2017-05-17 00:36 pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:08 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
@ 2017-05-17 14:14 ` Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:23 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 15:55 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
0 siblings, 2 replies; 22+ messages in thread
From: Tom Lane @ 2017-05-17 14:14 UTC (permalink / raw)
To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: pgsql-hackers@postgresql.org
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> There are some changes here that should be reverted; for instance:
> - printf(_(" -c, --checkpoint=fast|spread\n"
> - " set fast or spread checkpointing\n"));
> + printf(_(" -c, --checkpoint=fast|spread\n"));
> + printf(_(" set fast or spread checkpointing\n"));
> From the translator's point of view the patched version doesn't make
> sense because they are two separate strings. In the original, it's a
> single translatable string. Particularly in pg_waldump's -p, where a
> phrase is now cut in the middle.
What I was concerned about was that pgindent will reindent the second
line so that it's impossible to tell whether the spacing is correct.
That might not matter to translators but it will be a problem for
source-level maintenance.
Maybe we should rethink the whole idea of breaking these entries across
lines, and just accept that the commentary doesn't line up with other
lines:
printf(_(" -c, --checkpoint=fast|spread set fast or spread checkpointing\n"));
Thoughts?
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run.
2017-05-17 00:36 pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:08 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 14:14 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
@ 2017-05-17 14:23 ` Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 15:37 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 1 reply; 22+ messages in thread
From: Tom Lane @ 2017-05-17 14:23 UTC (permalink / raw)
To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: pgsql-hackers@postgresql.org
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
>> ... Particularly in pg_waldump's -p, where a
>> phrase is now cut in the middle.
BTW, I would say that the problem with -p is that somebody failed to
understand the difference between --help and a man page. That entry
should be
-p, --path=PATH directory in which to find log segment files
full stop. I'm not sure that the other multi-line entries in
pg_waldump's --help have an excuse to live, either.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run.
2017-05-17 00:36 pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:08 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 14:14 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:23 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
@ 2017-05-17 15:37 ` Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 15:52 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
0 siblings, 1 reply; 22+ messages in thread
From: Tom Lane @ 2017-05-17 15:37 UTC (permalink / raw)
To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: pgsql-hackers@postgresql.org
I wrote:
> BTW, I would say that the problem with -p is that somebody failed to
> understand the difference between --help and a man page.
Concretely, how about the attached? I don't think this looks any
worse than the current layout.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Attachments:
[text/x-diff] tighten-usage-printouts.patch (4.6K, ../../9404.1495035429@sss.pgh.pa.us/2-tighten-usage-printouts.patch)
download | inline diff:
diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c
index 866f88a..f2492e4 100644
--- a/src/bin/pg_basebackup/pg_basebackup.c
+++ b/src/bin/pg_basebackup/pg_basebackup.c
@@ -331,22 +331,17 @@ usage(void)
printf(_("\nOptions controlling the output:\n"));
printf(_(" -D, --pgdata=DIRECTORY receive base backup into directory\n"));
printf(_(" -F, --format=p|t output format (plain (default), tar)\n"));
- printf(_(" -r, --max-rate=RATE maximum transfer rate to transfer data directory\n"));
- printf(_(" (in kB/s, or use suffix \"k\" or \"M\")\n"));
- printf(_(" -R, --write-recovery-conf\n"));
- printf(_(" write recovery.conf for replication\n"));
+ printf(_(" -r, --max-rate=RATE maximum transfer rate (in kB/s)\n"));
+ printf(_(" -R, --write-recovery-conf write recovery.conf for replication\n"));
printf(_(" -S, --slot=SLOTNAME replication slot to use\n"));
printf(_(" --no-slot prevent creation of temporary replication slot\n"));
- printf(_(" -T, --tablespace-mapping=OLDDIR=NEWDIR\n"));
- printf(_(" relocate tablespace in OLDDIR to NEWDIR\n"));
- printf(_(" -X, --wal-method=none|fetch|stream\n"));
- printf(_(" include required WAL files with specified method\n"));
+ printf(_(" -T, --tablespace-mapping=OLDDIR=NEWDIR relocate tablespace\n"));
+ printf(_(" -X, --wal-method=none|fetch|stream set method for including WAL files\n"));
printf(_(" --waldir=WALDIR location for the write-ahead log directory\n"));
printf(_(" -z, --gzip compress tar output\n"));
printf(_(" -Z, --compress=0-9 compress tar output with given compression level\n"));
printf(_("\nGeneral options:\n"));
- printf(_(" -c, --checkpoint=fast|spread\n"));
- printf(_(" set fast or spread checkpointing\n"));
+ printf(_(" -c, --checkpoint=fast|spread set fast or spread checkpointing\n"));
printf(_(" -l, --label=LABEL set backup label\n"));
printf(_(" -n, --no-clean do not clean up after errors\n"));
printf(_(" -N, --no-sync do not wait for changes to be written safely to disk\n"));
@@ -358,8 +353,7 @@ usage(void)
printf(_(" -d, --dbname=CONNSTR connection string\n"));
printf(_(" -h, --host=HOSTNAME database server host or socket directory\n"));
printf(_(" -p, --port=PORT database server port number\n"));
- printf(_(" -s, --status-interval=INTERVAL\n"));
- printf(_(" time between status packets sent to server (in seconds)\n"));
+ printf(_(" -s, --status-interval=SECONDS set time between status packets\n"));
printf(_(" -U, --username=NAME connect as specified database user\n"));
printf(_(" -w, --no-password never prompt for password\n"));
printf(_(" -W, --password force password prompt (should happen automatically)\n"));
diff --git a/src/bin/pg_waldump/pg_waldump.c b/src/bin/pg_waldump/pg_waldump.c
index 56843a5..e56d7e2 100644
--- a/src/bin/pg_waldump/pg_waldump.c
+++ b/src/bin/pg_waldump/pg_waldump.c
@@ -689,18 +689,14 @@ usage(void)
printf(_(" -e, --end=RECPTR stop reading at WAL location RECPTR\n"));
printf(_(" -f, --follow keep retrying after reaching end of WAL\n"));
printf(_(" -n, --limit=N number of records to display\n"));
- printf(_(" -p, --path=PATH directory in which to find log segment files or a\n"));
- printf(_(" directory with a ./pg_wal that contains such files\n"));
- printf(_(" (default: current directory, ./pg_wal, PGDATA/pg_wal)\n"));
+ printf(_(" -p, --path=PATH directory in which to find log segment files\n"));
printf(_(" -r, --rmgr=RMGR only show records generated by resource manager RMGR\n"));
printf(_(" use --rmgr=list to list valid resource manager names\n"));
printf(_(" -s, --start=RECPTR start reading at WAL location RECPTR\n"));
printf(_(" -t, --timeline=TLI timeline from which to read log records\n"));
- printf(_(" (default: 1 or the value used in STARTSEG)\n"));
printf(_(" -V, --version output version information, then exit\n"));
printf(_(" -x, --xid=XID only show records with TransactionId XID\n"));
- printf(_(" -z, --stats[=record] show statistics instead of records\n"));
- printf(_(" (optionally, show per-record statistics)\n"));
+ printf(_(" -z, --stats[=record] show statistics or per-record statistics, not records\n"));
printf(_(" -?, --help show this help, then exit\n"));
}
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run.
2017-05-17 00:36 pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:08 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 14:14 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:23 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 15:37 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
@ 2017-05-17 15:52 ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2017-05-17 16:38 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 22+ messages in thread
From: Peter Eisentraut @ 2017-05-17 15:52 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: pgsql-hackers@postgresql.org
On 5/17/17 11:37, Tom Lane wrote:
> I wrote:
>> BTW, I would say that the problem with -p is that somebody failed to
>> understand the difference between --help and a man page.
>
> Concretely, how about the attached? I don't think this looks any
> worse than the current layout.
The previous setup has been in place for years and has never been a
problem. The alternatives are all quite a bit worse.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run.
2017-05-17 00:36 pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:08 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 14:14 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:23 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 15:37 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 15:52 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
@ 2017-05-17 16:38 ` Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 16:44 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
0 siblings, 1 reply; 22+ messages in thread
From: Tom Lane @ 2017-05-17 16:38 UTC (permalink / raw)
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; +Cc: Alvaro Herrera <alvherre@2ndquadrant.com>; pgsql-hackers@postgresql.org
Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
> On 5/17/17 11:37, Tom Lane wrote:
>> Concretely, how about the attached? I don't think this looks any
>> worse than the current layout.
> The previous setup has been in place for years and has never been a
> problem. The alternatives are all quite a bit worse.
No, the previous setup hasn't been "in place for years". These programs
were only NLS-ified last fall. Before that the code looked like, eg,
printf(" -z, --stats[=record] show statistics instead of records\n");
printf(" (optionally, show per-record statistics)\n");
so that there weren't string continuations for pgindent to fool with.
I'm not really convinced that having usage() print two- or three-line
switch descriptions is "quite a bit better" than what I suggested.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run.
2017-05-17 00:36 pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:08 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 14:14 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:23 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 15:37 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 15:52 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2017-05-17 16:38 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
@ 2017-05-17 16:44 ` Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 17:06 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 22+ messages in thread
From: Alvaro Herrera @ 2017-05-17 16:44 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; pgsql-hackers@postgresql.org
Tom Lane wrote:
> Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
> > On 5/17/17 11:37, Tom Lane wrote:
> >> Concretely, how about the attached? I don't think this looks any
> >> worse than the current layout.
>
> > The previous setup has been in place for years and has never been a
> > problem. The alternatives are all quite a bit worse.
>
> No, the previous setup hasn't been "in place for years". These programs
> were only NLS-ified last fall.
We use the same technique in other places such as pg_dump's help() too.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run.
2017-05-17 00:36 pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:08 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 14:14 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:23 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 15:37 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 15:52 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2017-05-17 16:38 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 16:44 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
@ 2017-05-17 17:06 ` Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 17:16 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 18:05 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Bruce Momjian <bruce@momjian.us>
0 siblings, 2 replies; 22+ messages in thread
From: Tom Lane @ 2017-05-17 17:06 UTC (permalink / raw)
To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; pgsql-hackers@postgresql.org
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> Tom Lane wrote:
>> No, the previous setup hasn't been "in place for years". These programs
>> were only NLS-ified last fall.
> We use the same technique in other places such as pg_dump's help() too.
Meh. Well, I reverted the changes in question while we discuss it.
Changing the pgindent rule for such cases sounds kind of promising,
but will anyone pursue it?
(In any case, we should probably go ahead with the scheduled pgindent
run, and then we can consider a new run with new rules later; that
will ease seeing exactly what changes a new rule would make.)
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run.
2017-05-17 00:36 pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:08 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 14:14 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:23 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 15:37 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 15:52 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2017-05-17 16:38 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 16:44 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 17:06 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
@ 2017-05-17 17:16 ` Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 18:13 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Piotr Stefaniak <postgres@piotr-stefaniak.me>
1 sibling, 1 reply; 22+ messages in thread
From: Alvaro Herrera @ 2017-05-17 17:16 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; pgsql-hackers@postgresql.org
Tom Lane wrote:
> Changing the pgindent rule for such cases sounds kind of promising,
> but will anyone pursue it?
We have someone who has studied the BSD indent code and even sent us
patches to fix quite a few bugs, but we've largely ignored his efforts
so far. I propose we take that indent as part of our repo, and patch it
to our preferences.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run.
2017-05-17 00:36 pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:08 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 14:14 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:23 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 15:37 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 15:52 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2017-05-17 16:38 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 16:44 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 17:06 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 17:16 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
@ 2017-05-17 18:13 ` Piotr Stefaniak <postgres@piotr-stefaniak.me>
2017-05-17 20:09 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-18 16:13 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 2 replies; 22+ messages in thread
From: Piotr Stefaniak @ 2017-05-17 18:13 UTC (permalink / raw)
To: Alvaro Herrera <alvherre@2ndquadrant.com>; Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
On 2017-05-17 19:16, Alvaro Herrera wrote:
> Tom Lane wrote:
>
>> Changing the pgindent rule for such cases sounds kind of promising,
>> but will anyone pursue it?
>
> We have someone who has studied the BSD indent code and even sent us
> patches to fix quite a few bugs, but we've largely ignored his efforts
> so far. I propose we take that indent as part of our repo, and patch it
> to our preferences.
That, I assume, would be me. Coincidentally, I'm about to push my fixes
upstream (FreeBSD). Before that happens, my changes can be obtained from
https://github.com/pstef/freebsd_indent and tested, if anyone wishes.
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run.
2017-05-17 00:36 pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:08 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 14:14 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:23 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 15:37 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 15:52 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2017-05-17 16:38 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 16:44 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 17:06 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 17:16 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 18:13 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Piotr Stefaniak <postgres@piotr-stefaniak.me>
@ 2017-05-17 20:09 ` Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 0 replies; 22+ messages in thread
From: Tom Lane @ 2017-05-17 20:09 UTC (permalink / raw)
To: Piotr Stefaniak <postgres@piotr-stefaniak.me>; +Cc: Alvaro Herrera <alvherre@2ndquadrant.com>; Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Piotr Stefaniak <postgres@piotr-stefaniak.me> writes:
> That, I assume, would be me. Coincidentally, I'm about to push my fixes
> upstream (FreeBSD). Before that happens, my changes can be obtained from
> https://github.com/pstef/freebsd_indent and tested, if anyone wishes.
Do you have recommendations for the switches to use with this to
match PG style? It doesn't look like it takes quite the same
switches as the old netbsd code.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run.
2017-05-17 00:36 pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:08 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 14:14 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:23 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 15:37 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 15:52 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2017-05-17 16:38 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 16:44 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 17:06 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 17:16 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 18:13 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Piotr Stefaniak <postgres@piotr-stefaniak.me>
@ 2017-05-18 16:13 ` Tom Lane <tgl@sss.pgh.pa.us>
2017-05-18 20:51 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Piotr Stefaniak <postgres@piotr-stefaniak.me>
1 sibling, 1 reply; 22+ messages in thread
From: Tom Lane @ 2017-05-18 16:13 UTC (permalink / raw)
To: Piotr Stefaniak <postgres@piotr-stefaniak.me>; +Cc: Alvaro Herrera <alvherre@2ndquadrant.com>; Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Piotr Stefaniak <postgres@piotr-stefaniak.me> writes:
> That, I assume, would be me. Coincidentally, I'm about to push my fixes
> upstream (FreeBSD). Before that happens, my changes can be obtained from
> https://github.com/pstef/freebsd_indent and tested, if anyone wishes.
I spent a little bit of time on portability testing, because we are
certainly going to insist that this tool be portable to more than
just FreeBSD. Things are not very good as it stands:
* Makefile is 100% BSD-specific. Possibly we could just agree to
disagree on that point, and include a PG-style makefile that is not
like upstream's. I attach the one I used for test purposes.
* __FBSDID() macros fail to compile anywhere else than FreeBSD.
Couldn't you hide those inside #if 0, as you're already doing for
the ancient sccsid strings?
* Please put the copyright[] string in indent.c inside #if 0 too,
as that draws unreferenced-variable warnings on some compilers.
* There's one use of bcopy(), please replace with memmove().
* References to <sys/cdefs.h> and <err.h> are problematic, as both
are BSD-isms not found in POSIX. They seem to be available anyway
on Linux, but I bet not on Windows or SysV-tradition boxes.
I removed the <sys/cdefs.h> includes and didn't see any problems,
but removing <err.h> exposes calls to err() and errx(), which
we'd have to find replacements for. Maybe just change them to
standard-conforming printf() + exit()?
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Attachments:
[text/x-makefile] Makefile (894B, ../../24704.1495124016@sss.pgh.pa.us/2-Makefile)
download | inline:
#-------------------------------------------------------------------------
#
# Makefile for src/tools/freebsd_indent
#
# Copyright (c) 2003-2017, PostgreSQL Global Development Group
#
# src/tools/freebsd_indent/Makefile
#
#-------------------------------------------------------------------------
subdir = src/tools/freebsd_indent
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
override CPPFLAGS := -I. -I$(srcdir) $(CPPFLAGS)
OBJS= args.o indent.o io.o lexi.o parse.o pr_comment.o
all: freebsd_indent
freebsd_indent: $(OBJS)
$(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) $(LDFLAGS_EX) -o $@$(X)
install: all installdirs
$(INSTALL_PROGRAM) freebsd_indent$(X) '$(DESTDIR)$(bindir)/freebsd_indent$(X)'
installdirs:
$(MKDIR_P) '$(DESTDIR)$(bindir)'
uninstall:
rm -f '$(DESTDIR)$(bindir)/freebsd_indent$(X)'
clean distclean maintainer-clean:
rm -f freebsd_indent$(X) $(OBJS)
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run.
2017-05-17 00:36 pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:08 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 14:14 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:23 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 15:37 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 15:52 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2017-05-17 16:38 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 16:44 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 17:06 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 17:16 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 18:13 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Piotr Stefaniak <postgres@piotr-stefaniak.me>
2017-05-18 16:13 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
@ 2017-05-18 20:51 ` Piotr Stefaniak <postgres@piotr-stefaniak.me>
0 siblings, 0 replies; 22+ messages in thread
From: Piotr Stefaniak @ 2017-05-18 20:51 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Alvaro Herrera <alvherre@2ndquadrant.com>; Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
On 2017-05-18 18:13, Tom Lane wrote:
> Piotr Stefaniak <postgres@piotr-stefaniak.me> writes:
>> That, I assume, would be me. Coincidentally, I'm about to push my fixes
>> upstream (FreeBSD). Before that happens, my changes can be obtained from
>> https://github.com/pstef/freebsd_indent and tested, if anyone wishes.
>
> I spent a little bit of time on portability testing, because we are
> certainly going to insist that this tool be portable to more than
> just FreeBSD. Things are not very good as it stands:
>
> * Makefile is 100% BSD-specific. Possibly we could just agree to
> disagree on that point, and include a PG-style makefile that is not
> like upstream's. I attach the one I used for test purposes.
This would have to live outside of FreeBSD for obvious (or not) reasons.
Most likely as a part of pg_bsd_indent. I use the original ("BSD")
Makefile on Linux, feeding it to bmake(1). But I don't expect bmake to
become a requirement for pg_bsd_indent.
> * __FBSDID() macros fail to compile anywhere else than FreeBSD.
> Couldn't you hide those inside #if 0, as you're already doing for
> the ancient sccsid strings?
The use of __FBSDID macro won't be going anywhere from FreeBSD indent,
I'm afraid. But I think it could be if-def'd out under systems other
than FreeBSD.
> * Please put the copyright[] string in indent.c inside #if 0 too,
> as that draws unreferenced-variable warnings on some compilers.
>
> * There's one use of bcopy(), please replace with memmove().
These could probably be done upstream. I'd like to convert the strings
to comments.
> * References to <sys/cdefs.h> and <err.h> are problematic, as both
> are BSD-isms not found in POSIX. They seem to be available anyway
> on Linux, but I bet not on Windows or SysV-tradition boxes.
> I removed the <sys/cdefs.h> includes and didn't see any problems,
> but removing <err.h> exposes calls to err() and errx(), which
> we'd have to find replacements for. Maybe just change them to
> standard-conforming printf() + exit()?
I'll look into why indent includes sys/cdefs.h. I don't expect to be
allowed to replace err() and errx() with equivalent solutions based on
ISO C and POSIX. I fear the idea of detecting err*() support prior to
compilation... Probably a much simpler solution would be to replace
err*() with equivalent solutions in the PG's fork of indent. printf()
and exit() would probably be insufficient, you'd also need strerror(), I
think.
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run.
2017-05-17 00:36 pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:08 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 14:14 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:23 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 15:37 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 15:52 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2017-05-17 16:38 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 16:44 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 17:06 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
@ 2017-05-17 18:05 ` Bruce Momjian <bruce@momjian.us>
2017-05-17 18:22 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 1 reply; 22+ messages in thread
From: Bruce Momjian @ 2017-05-17 18:05 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Alvaro Herrera <alvherre@2ndquadrant.com>; Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; pgsql-hackers@postgresql.org
On Wed, May 17, 2017 at 01:06:26PM -0400, Tom Lane wrote:
> Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> > Tom Lane wrote:
> >> No, the previous setup hasn't been "in place for years". These programs
> >> were only NLS-ified last fall.
>
> > We use the same technique in other places such as pg_dump's help() too.
>
> Meh. Well, I reverted the changes in question while we discuss it.
Are we ready for a pgindent run now?
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ As you are, so once was I. As I am, so you will be. +
+ Ancient Roman grave inscription +
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run.
2017-05-17 00:36 pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:08 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 14:14 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:23 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 15:37 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 15:52 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2017-05-17 16:38 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 16:44 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 17:06 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 18:05 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Bruce Momjian <bruce@momjian.us>
@ 2017-05-17 18:22 ` Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 18:25 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Stephen Frost <sfrost@snowman.net>
0 siblings, 1 reply; 22+ messages in thread
From: Tom Lane @ 2017-05-17 18:22 UTC (permalink / raw)
To: Bruce Momjian <bruce@momjian.us>; +Cc: Alvaro Herrera <alvherre@2ndquadrant.com>; Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; pgsql-hackers@postgresql.org
Bruce Momjian <bruce@momjian.us> writes:
> Are we ready for a pgindent run now?
Yes, might as well do it. Some of these discussions might lead to
a re-run with a newer version of pgindent, but it would be good to
have a clean tree to start from.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run.
2017-05-17 00:36 pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:08 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 14:14 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:23 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 15:37 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 15:52 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2017-05-17 16:38 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 16:44 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 17:06 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 18:05 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Bruce Momjian <bruce@momjian.us>
2017-05-17 18:22 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
@ 2017-05-17 18:25 ` Stephen Frost <sfrost@snowman.net>
0 siblings, 0 replies; 22+ messages in thread
From: Stephen Frost @ 2017-05-17 18:25 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Bruce Momjian <bruce@momjian.us>; Alvaro Herrera <alvherre@2ndquadrant.com>; Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; pgsql-hackers@postgresql.org
Tom, all,
* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > Are we ready for a pgindent run now?
>
> Yes, might as well do it. Some of these discussions might lead to
> a re-run with a newer version of pgindent, but it would be good to
> have a clean tree to start from.
+1.
Thanks!
Stephen
Attachments:
[application/pgp-signature] signature.asc (818B, ../../20170517182510.GI3151@tamriel.snowman.net/2-signature.asc)
download
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run.
2017-05-17 00:36 pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:08 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 14:14 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
@ 2017-05-17 15:55 ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2017-05-17 16:39 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 21:03 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Piotr Stefaniak <postgres@piotr-stefaniak.me>
1 sibling, 2 replies; 22+ messages in thread
From: Peter Eisentraut @ 2017-05-17 15:55 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: pgsql-hackers@postgresql.org
On 5/17/17 10:14, Tom Lane wrote:
> What I was concerned about was that pgindent will reindent the second
> line so that it's impossible to tell whether the spacing is correct.
pgindent moving string continuations to the left is a completely
terrible behavior anyway and we should look into changing that. Just
look at the mess it makes out of SELECT queries in pg_dump.c.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run.
2017-05-17 00:36 pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:08 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 14:14 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 15:55 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
@ 2017-05-17 16:39 ` Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 0 replies; 22+ messages in thread
From: Tom Lane @ 2017-05-17 16:39 UTC (permalink / raw)
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; +Cc: Alvaro Herrera <alvherre@2ndquadrant.com>; pgsql-hackers@postgresql.org
Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
> On 5/17/17 10:14, Tom Lane wrote:
>> What I was concerned about was that pgindent will reindent the second
>> line so that it's impossible to tell whether the spacing is correct.
> pgindent moving string continuations to the left is a completely
> terrible behavior anyway and we should look into changing that. Just
> look at the mess it makes out of SELECT queries in pg_dump.c.
I'd be on board with that, perhaps, but does anyone here have enough
insight into bsd_indent to fix that without breaking other stuff?
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run.
2017-05-17 00:36 pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:08 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 14:14 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 15:55 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
@ 2017-05-17 21:03 ` Piotr Stefaniak <postgres@piotr-stefaniak.me>
2017-05-17 21:13 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
1 sibling, 1 reply; 22+ messages in thread
From: Piotr Stefaniak @ 2017-05-17 21:03 UTC (permalink / raw)
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; Tom Lane <tgl@sss.pgh.pa.us>; Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
On 2017-05-17 17:55, Peter Eisentraut wrote:
> On 5/17/17 10:14, Tom Lane wrote:
>> What I was concerned about was that pgindent will reindent the second
>> line so that it's impossible to tell whether the spacing is correct.
>
> pgindent moving string continuations to the left is a completely
> terrible behavior anyway and we should look into changing that. Just
> look at the mess it makes out of SELECT queries in pg_dump.c.
If I remember correctly, it tries to right-align string literals to
whatever -l ("Maximum length of an output line") was set to.
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run.
2017-05-17 00:36 pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:08 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 14:14 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 15:55 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2017-05-17 21:03 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Piotr Stefaniak <postgres@piotr-stefaniak.me>
@ 2017-05-17 21:13 ` Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 21:55 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 22+ messages in thread
From: Alvaro Herrera @ 2017-05-17 21:13 UTC (permalink / raw)
To: Piotr Stefaniak <postgres@piotr-stefaniak.me>; +Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Piotr Stefaniak wrote:
> On 2017-05-17 17:55, Peter Eisentraut wrote:
> > On 5/17/17 10:14, Tom Lane wrote:
> >> What I was concerned about was that pgindent will reindent the second
> >> line so that it's impossible to tell whether the spacing is correct.
> >
> > pgindent moving string continuations to the left is a completely
> > terrible behavior anyway and we should look into changing that. Just
> > look at the mess it makes out of SELECT queries in pg_dump.c.
>
> If I remember correctly, it tries to right-align string literals to
> whatever -l ("Maximum length of an output line") was set to.
Yeah, it does that (for error messages too).
I'm not sure what's the behavior we do want. One choice is that the
continuation string opening quote should line up with the opening quote
in the previous line. So for instance:
elog(ERROR, "this message is very long"
"and the second line may get over the 80 chars limit if we let it");
but I suppose some we would like the opening quote to line up with the
parens:
elog(ERROR, "this message is very long "
"and the second line may get over the 80 chars limit if we let it");
I vote that the first form is best, even if it would cause me some pain
because my vim config doesn't line up continuations like that. (Not sure
I can tweak it to work that way.)
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run.
2017-05-17 00:36 pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:08 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 14:14 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 15:55 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2017-05-17 21:03 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Piotr Stefaniak <postgres@piotr-stefaniak.me>
2017-05-17 21:13 ` Re: [COMMITTERS] pgsql: Preventive maintenance in advance of pgindent run. Alvaro Herrera <alvherre@2ndquadrant.com>
@ 2017-05-17 21:55 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 22+ messages in thread
From: Tom Lane @ 2017-05-17 21:55 UTC (permalink / raw)
To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: Piotr Stefaniak <postgres@piotr-stefaniak.me>; Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> Piotr Stefaniak wrote:
>> If I remember correctly, it tries to right-align string literals to
>> whatever -l ("Maximum length of an output line") was set to.
> Yeah, it does that (for error messages too).
Piotr's version seems to at least do this more consistently than the
old version; for instance I notice this diff from Bruce's run:
@@ -1864,8 +1864,8 @@ describeOneTableDetails(const char *schemaname,
if (verbose)
printfPQExpBuffer(&buf,
"SELECT inhparent::pg_catalog.regclass,"
- " pg_get_expr(c.relpartbound, inhrelid),"
- " pg_get_partition_constraintdef(inhrelid)"
+ " pg_get_expr(c.relpartbound, inhrelid),"
+ " pg_get_partition_constraintdef(inhrelid)"
" FROM pg_catalog.pg_class c"
" JOIN pg_catalog.pg_inherits"
" ON c.oid = inhrelid"
(Again, untabified for clarity.) However, it didn't do anything to any of
the horribly-formatted queries in pg_dump.c, so it's mostly following the
same rule as before.
> I'm not sure what's the behavior we do want. One choice is that the
> continuation string opening quote should line up with the opening quote
> in the previous line. So for instance:
Yeah, I'd vote for that one too. If you want to line things up with
a function call paren, you can always start the whole literal on a fresh
line, as in the above example.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 22+ messages in thread
end of thread, other threads:[~2017-05-18 20:51 UTC | newest]
Thread overview: 22+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-05-17 00:36 pgsql: Preventive maintenance in advance of pgindent run. Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:08 ` Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 14:14 ` Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 14:23 ` Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 15:37 ` Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 15:52 ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2017-05-17 16:38 ` Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 16:44 ` Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 17:06 ` Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 17:16 ` Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 18:13 ` Piotr Stefaniak <postgres@piotr-stefaniak.me>
2017-05-17 20:09 ` Tom Lane <tgl@sss.pgh.pa.us>
2017-05-18 16:13 ` Tom Lane <tgl@sss.pgh.pa.us>
2017-05-18 20:51 ` Piotr Stefaniak <postgres@piotr-stefaniak.me>
2017-05-17 18:05 ` Bruce Momjian <bruce@momjian.us>
2017-05-17 18:22 ` Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 18:25 ` Stephen Frost <sfrost@snowman.net>
2017-05-17 15:55 ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2017-05-17 16:39 ` Tom Lane <tgl@sss.pgh.pa.us>
2017-05-17 21:03 ` Piotr Stefaniak <postgres@piotr-stefaniak.me>
2017-05-17 21:13 ` Alvaro Herrera <alvherre@2ndquadrant.com>
2017-05-17 21:55 ` Tom Lane <tgl@sss.pgh.pa.us>
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