Thread

Commits

  1. Refer readers of \? to "\? variables" for pset options

  2. Have psql's "\? variables" show csv_fieldsep

  3. Add CSV table output mode in psql.

  1. psql --help=variables missing csv_fieldsep

    Álvaro Herrera <alvherre@kurilemu.de> — 2025-11-03T17:44:31Z

    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.
    
  2. Re: psql --help=variables missing csv_fieldsep

    Tom Lane <tgl@sss.pgh.pa.us> — 2025-11-03T17:59:45Z

    =?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
    
    
    
    
  3. Re: psql --help=variables missing csv_fieldsep

    Tom Lane <tgl@sss.pgh.pa.us> — 2025-11-03T18:03:51Z

    =?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
    
    
    
    
  4. Re: psql --help=variables missing csv_fieldsep

    Álvaro Herrera <alvherre@kurilemu.de> — 2025-11-03T20:20:28Z

    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."
    
    
    
    
  5. Re: psql --help=variables missing csv_fieldsep

    Tom Lane <tgl@sss.pgh.pa.us> — 2025-11-03T20:53:29Z

    =?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
    
    
    
    
  6. Re: psql --help=variables missing csv_fieldsep

    Álvaro Herrera <alvherre@kurilemu.de> — 2025-11-04T16:39:20Z

    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/
    
  7. Re: psql --help=variables missing csv_fieldsep

    Tom Lane <tgl@sss.pgh.pa.us> — 2025-11-04T16:44:24Z

    =?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
    
    
    
    
  8. Re: psql --help=variables missing csv_fieldsep

    Álvaro Herrera <alvherre@kurilemu.de> — 2025-11-06T16:37:57Z

    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)