pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feedpsql --help=variables missing csv_fieldsep
8+ messages / 2 participants
[nested] [flat]
Commits from this thread:
2025-11-06 8fe7700b7e Refer readers of \? to "\? variables" for pset options
2025-11-04 9c742c3943 8864016118 e1e79791af 87fbbd48c2 42fa4dba84 93b7ab5b4b 2c56b70695 Have psql's "\? variables" show csv_fieldsep
* psql --help=variables missing csv_fieldsep
@ 2025-11-03 17:44 Álvaro Herrera <alvherre@kurilemu.de>
2025-11-03 17:59 ` Re: psql --help=variables missing csv_fieldsep Tom Lane <tgl@sss.pgh.pa.us>
2025-11-03 18:03 ` Re: psql --help=variables missing csv_fieldsep Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 2 replies; 8+ messages in thread
From: Álvaro Herrera @ 2025-11-03 17:44 UTC (permalink / raw)
To: Pg Hackers <pgsql-hackers@lists.postgresql.org>; +Cc: Daniel Verite <daniel@manitou-mail.org>; Tom Lane <tgl@sss.pgh.pa.us>
While messing with the \pset boolean display patch, I noticed that psql
--help=variables is missing csv_fieldsep. Is there a reason for this?
It appears to be an omission of commit aa2ba50c2c13 -- accidental?
The attached patch adds it.
--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
Y una voz del caos me habló y me dijo
"Sonríe y sé feliz, podría ser peor".
Y sonreí. Y fui feliz.
Y fue peor.
Attachments:
0001-Have-psql-s-variables-show-csv_fieldsep.patch (text/x-diff, 919B) download
From 2c452061b1e1388a7127fb7fd407c949aa6bec20 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=81lvaro=20Herrera?= <alvherre@kurilemu.de>
Date: Mon, 3 Nov 2025 18:37:29 +0100
Subject: [PATCH] Have psql's "\? variables" show csv_fieldsep
The omission is unexplained.
---
src/bin/psql/help.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index 6ae1a9940de..b635aa7dc57 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -480,6 +480,9 @@ helpVariables(unsigned short int pager)
" border style (number)\n");
HELP0(" columns\n"
" target width for the wrapped format\n");
+ HELPN(" csv_fieldsep\n"
+ " field separator to be used in CSV output format (default \"%c\")\n",
+ DEFAULT_CSV_FIELD_SEP);
HELP0(" display_false\n"
" set the string to be printed in place of a boolean 'false'\n");
HELP0(" display_true\n"
--
2.47.3
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: psql --help=variables missing csv_fieldsep
2025-11-03 17:44 psql --help=variables missing csv_fieldsep Álvaro Herrera <alvherre@kurilemu.de>
@ 2025-11-03 17:59 ` Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 0 replies; 8+ messages in thread
From: Tom Lane @ 2025-11-03 17:59 UTC (permalink / raw)
To: Álvaro Herrera <alvherre@kurilemu.de>; +Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>; Daniel Verite <daniel@manitou-mail.org>
=?utf-8?Q?=C3=81lvaro?= Herrera <alvherre@kurilemu.de> writes:
> While messing with the \pset boolean display patch, I noticed that psql
> --help=variables is missing csv_fieldsep. Is there a reason for this?
> It appears to be an omission of commit aa2ba50c2c13 -- accidental?
Seems like a pretty easy oversight to make. I wonder if there is some
way to cross-check help.c and psql-ref.sgml with the variables and
commands actually implemented in the code ...
regards, tom lane
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: psql --help=variables missing csv_fieldsep
2025-11-03 17:44 psql --help=variables missing csv_fieldsep Álvaro Herrera <alvherre@kurilemu.de>
@ 2025-11-03 18:03 ` Tom Lane <tgl@sss.pgh.pa.us>
2025-11-03 20:20 ` Re: psql --help=variables missing csv_fieldsep Álvaro Herrera <alvherre@kurilemu.de>
1 sibling, 1 reply; 8+ messages in thread
From: Tom Lane @ 2025-11-03 18:03 UTC (permalink / raw)
To: Álvaro Herrera <alvherre@kurilemu.de>; +Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>; Daniel Verite <daniel@manitou-mail.org>
=?utf-8?Q?=C3=81lvaro?= Herrera <alvherre@kurilemu.de> writes:
> While messing with the \pset boolean display patch, I noticed that psql
> --help=variables is missing csv_fieldsep. Is there a reason for this?
But wait ... is it actually a variable? help.c does list it, but
as a \pset option:
HELP0(" \\pset [NAME [VALUE]] set table output option\n"
" (border|columns|csv_fieldsep|display_false|display_true|\n"
...
Some kind of mechanical cross-check does seem like a good idea,
even if it's just a rough one-time effort.
regards, tom lane
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: psql --help=variables missing csv_fieldsep
2025-11-03 17:44 psql --help=variables missing csv_fieldsep Álvaro Herrera <alvherre@kurilemu.de>
2025-11-03 18:03 ` Re: psql --help=variables missing csv_fieldsep Tom Lane <tgl@sss.pgh.pa.us>
@ 2025-11-03 20:20 ` Álvaro Herrera <alvherre@kurilemu.de>
2025-11-03 20:53 ` Re: psql --help=variables missing csv_fieldsep Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 8+ messages in thread
From: Álvaro Herrera @ 2025-11-03 20:20 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>; Daniel Verite <daniel@manitou-mail.org>
On 2025-Nov-03, Tom Lane wrote:
> =?utf-8?Q?=C3=81lvaro?= Herrera <alvherre@kurilemu.de> writes:
> > While messing with the \pset boolean display patch, I noticed that psql
> > --help=variables is missing csv_fieldsep. Is there a reason for this?
>
> But wait ... is it actually a variable? help.c does list it, but
> as a \pset option:
>
> HELP0(" \\pset [NAME [VALUE]] set table output option\n"
> " (border|columns|csv_fieldsep|display_false|display_true|\n"
Yeah, there are two lists: one here in the "\?" output, and another in
the "\? variables" output, which is also `psql --help=variables`. It
lists actual variables but also \pset options and environment variables
psql recognizes. I find this one you quote somewhat unreadable, so I
was going to propose to remove it, and instead direct the user to look
at "\? variables" for the exhaustive list. That one is also a bit
easier to cross-check, I think. (There's also tab-complete.)
--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
"No renuncies a nada. No te aferres a nada."
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: psql --help=variables missing csv_fieldsep
2025-11-03 17:44 psql --help=variables missing csv_fieldsep Álvaro Herrera <alvherre@kurilemu.de>
2025-11-03 18:03 ` Re: psql --help=variables missing csv_fieldsep Tom Lane <tgl@sss.pgh.pa.us>
2025-11-03 20:20 ` Re: psql --help=variables missing csv_fieldsep Álvaro Herrera <alvherre@kurilemu.de>
@ 2025-11-03 20:53 ` Tom Lane <tgl@sss.pgh.pa.us>
2025-11-04 16:39 ` Re: psql --help=variables missing csv_fieldsep Álvaro Herrera <alvherre@kurilemu.de>
0 siblings, 1 reply; 8+ messages in thread
From: Tom Lane @ 2025-11-03 20:53 UTC (permalink / raw)
To: Álvaro Herrera <alvherre@kurilemu.de>; +Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>; Daniel Verite <daniel@manitou-mail.org>
=?utf-8?Q?=C3=81lvaro?= Herrera <alvherre@kurilemu.de> writes:
> On 2025-Nov-03, Tom Lane wrote:
>> But wait ... is it actually a variable? help.c does list it, but
>> as a \pset option:
> Yeah, there are two lists: one here in the "\?" output, and another in
> the "\? variables" output, which is also `psql --help=variables`. It
> lists actual variables but also \pset options and environment variables
> psql recognizes.
Huh. I would not have called \pset options variables, but I guess
somebody thought it made sense.
> I find this one you quote somewhat unreadable, so I
> was going to propose to remove it, and instead direct the user to look
> at "\? variables" for the exhaustive list. That one is also a bit
> easier to cross-check, I think. (There's also tab-complete.)
Agreed that the set of \pset options has bloated to the point where
that presentation is unreadable.
regards, tom lane
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: psql --help=variables missing csv_fieldsep
2025-11-03 17:44 psql --help=variables missing csv_fieldsep Álvaro Herrera <alvherre@kurilemu.de>
2025-11-03 18:03 ` Re: psql --help=variables missing csv_fieldsep Tom Lane <tgl@sss.pgh.pa.us>
2025-11-03 20:20 ` Re: psql --help=variables missing csv_fieldsep Álvaro Herrera <alvherre@kurilemu.de>
2025-11-03 20:53 ` Re: psql --help=variables missing csv_fieldsep Tom Lane <tgl@sss.pgh.pa.us>
@ 2025-11-04 16:39 ` Álvaro Herrera <alvherre@kurilemu.de>
2025-11-04 16:44 ` Re: psql --help=variables missing csv_fieldsep Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 8+ messages in thread
From: Álvaro Herrera @ 2025-11-04 16:39 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>; Daniel Verite <daniel@manitou-mail.org>
On 2025-Nov-03, Tom Lane wrote:
> > I find this one you quote somewhat unreadable, so I
> > was going to propose to remove it, and instead direct the user to look
> > at "\? variables" for the exhaustive list. That one is also a bit
> > easier to cross-check, I think. (There's also tab-complete.)
>
> Agreed that the set of \pset options has bloated to the point where
> that presentation is unreadable.
How about this?
--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
Attachments:
0001-Refer-to-variables-for-pset-options.patch (text/x-diff, 1.5K) download
From 626966286636c9fc12adcd02bceb7eaeee94ff79 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=81lvaro=20Herrera?= <alvherre@kurilemu.de>
Date: Tue, 4 Nov 2025 17:34:52 +0100
Subject: [PATCH] Refer \? to "\? variables" for pset options
---
src/bin/psql/help.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index 45d20ea57bc..ec0b49b957b 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -290,12 +290,7 @@ slashUsage(unsigned short int pager)
HELPN(" \\H toggle HTML output mode (currently %s)\n",
ON(pset.popt.topt.format == PRINT_HTML));
HELP0(" \\pset [NAME [VALUE]] set table output option\n"
- " (border|columns|csv_fieldsep|display_false|display_true|\n"
- " expanded|fieldsep|fieldsep_zero|footer|format|linestyle|\n"
- " null|numericlocale|pager|pager_min_lines|recordsep|\n"
- " recordsep_zero|tableattr|title|tuples_only|\n"
- " unicode_border_linestyle|unicode_column_linestyle|\n"
- " unicode_header_linestyle|xheader_width)\n");
+ " see \"\\? variables\" for valid options\n");
HELPN(" \\t [on|off] show only rows (currently %s)\n",
ON(pset.popt.topt.tuples_only));
HELP0(" \\T [STRING] set HTML <table> tag attributes, or unset if none\n");
--
2.47.3
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: psql --help=variables missing csv_fieldsep
2025-11-03 17:44 psql --help=variables missing csv_fieldsep Álvaro Herrera <alvherre@kurilemu.de>
2025-11-03 18:03 ` Re: psql --help=variables missing csv_fieldsep Tom Lane <tgl@sss.pgh.pa.us>
2025-11-03 20:20 ` Re: psql --help=variables missing csv_fieldsep Álvaro Herrera <alvherre@kurilemu.de>
2025-11-03 20:53 ` Re: psql --help=variables missing csv_fieldsep Tom Lane <tgl@sss.pgh.pa.us>
2025-11-04 16:39 ` Re: psql --help=variables missing csv_fieldsep Álvaro Herrera <alvherre@kurilemu.de>
@ 2025-11-04 16:44 ` Tom Lane <tgl@sss.pgh.pa.us>
2025-11-06 16:37 ` Re: psql --help=variables missing csv_fieldsep Álvaro Herrera <alvherre@kurilemu.de>
0 siblings, 1 reply; 8+ messages in thread
From: Tom Lane @ 2025-11-04 16:44 UTC (permalink / raw)
To: Álvaro Herrera <alvherre@kurilemu.de>; +Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>; Daniel Verite <daniel@manitou-mail.org>
=?utf-8?Q?=C3=81lvaro?= Herrera <alvherre@kurilemu.de> writes:
> On 2025-Nov-03, Tom Lane wrote:
>> Agreed that the set of \pset options has bloated to the point where
>> that presentation is unreadable.
> How about this?
WFM.
regards, tom lane
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: psql --help=variables missing csv_fieldsep
2025-11-03 17:44 psql --help=variables missing csv_fieldsep Álvaro Herrera <alvherre@kurilemu.de>
2025-11-03 18:03 ` Re: psql --help=variables missing csv_fieldsep Tom Lane <tgl@sss.pgh.pa.us>
2025-11-03 20:20 ` Re: psql --help=variables missing csv_fieldsep Álvaro Herrera <alvherre@kurilemu.de>
2025-11-03 20:53 ` Re: psql --help=variables missing csv_fieldsep Tom Lane <tgl@sss.pgh.pa.us>
2025-11-04 16:39 ` Re: psql --help=variables missing csv_fieldsep Álvaro Herrera <alvherre@kurilemu.de>
2025-11-04 16:44 ` Re: psql --help=variables missing csv_fieldsep Tom Lane <tgl@sss.pgh.pa.us>
@ 2025-11-06 16:37 ` Álvaro Herrera <alvherre@kurilemu.de>
0 siblings, 0 replies; 8+ messages in thread
From: Álvaro Herrera @ 2025-11-06 16:37 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>; Daniel Verite <daniel@manitou-mail.org>
On 2025-Nov-04, Tom Lane wrote:
> =?utf-8?Q?=C3=81lvaro?= Herrera <alvherre@kurilemu.de> writes:
> > On 2025-Nov-03, Tom Lane wrote:
> >> Agreed that the set of \pset options has bloated to the point where
> >> that presentation is unreadable.
>
> > How about this?
>
> WFM.
Thanks, pushed.
--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
"La virtud es el justo medio entre dos defectos" (Aristóteles)
^ permalink raw reply [nested|flat] 8+ messages in thread
end of thread, other threads:[~2025-11-06 16:37 UTC | newest]
Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-11-03 17:44 psql --help=variables missing csv_fieldsep Álvaro Herrera <alvherre@kurilemu.de>
2025-11-03 17:59 ` Tom Lane <tgl@sss.pgh.pa.us>
2025-11-03 18:03 ` Tom Lane <tgl@sss.pgh.pa.us>
2025-11-03 20:20 ` Álvaro Herrera <alvherre@kurilemu.de>
2025-11-03 20:53 ` Tom Lane <tgl@sss.pgh.pa.us>
2025-11-04 16:39 ` Álvaro Herrera <alvherre@kurilemu.de>
2025-11-04 16:44 ` Tom Lane <tgl@sss.pgh.pa.us>
2025-11-06 16:37 ` Álvaro Herrera <alvherre@kurilemu.de>
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