While reviewing Andrew Dunstan's patch that implements the
log_disconnections GUC var, I noticed that tab-complete.c in psql
claims that only "USERSET and possibly SUSET" GUC variables should be
included in the list of variables that can be auto-completed.

That policy is clearly not followed: fsync, max_connections, port,
shared_buffers, ssl, wal_sync_method, and various other non-USERSET or
SUSET variables are presently included in the completion list.

The two obvious ways to fix this are to add the remaining variables to
the completion list and remove the USERSET/SUSET policy, or to remove
the variables that violate this policy. I think the former is a better
idea, for two reasons:

(1) tab-completing GUC variables that one cannot set is still
useful for SHOW

(2) enforcing semantic validity is something psql is clearly not
in a position to do in the general case, so it strikes me as
rather pointless to try

Any comments?

-Neil

Search Discussions

  • Tom Lane at Feb 9, 2004 at 2:47 am

    Neil Conway writes:
    While reviewing Andrew Dunstan's patch that implements the
    log_disconnections GUC var, I noticed that tab-complete.c in psql
    claims that only "USERSET and possibly SUSET" GUC variables should be
    included in the list of variables that can be auto-completed.
    I think I was the one who put in that suggestion (which I agree has been
    largely ignored subsequently). The motivation was to avoid cluttering
    the tab completion facility with seldom-used parameters. As an example,
    the presence of the "stats_xxx" parameters in the tab list means more
    keystrokes are needed to type "statement_timeout". Seems like this is a
    bad tradeoff considering that people would rarely bother to look at the
    stats settings.

    I'm not by any means wedded to the "USERSET and possibly SUSET" policy,
    but I would like to stop somewhere short of "include everything". Any
    thoughts?

    regards, tom lane
  • Neil Conway at Feb 9, 2004 at 7:22 am

    Tom Lane writes:
    I'm not by any means wedded to the "USERSET and possibly SUSET"
    policy, but I would like to stop somewhere short of "include
    everything". Any thoughts?
    Perhaps we could have two sets of variables: all the GUC vars (that
    can be displayed via SHOW), and a subset of those that can be set by
    the user. We could use the first set for tab-completion on SHOW and
    the second for tab completion on SET.

    -Neil

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-hackers @
categoriespostgresql
postedFeb 8, '04 at 11:17p
activeFeb 9, '04 at 7:22a
posts3
users2
websitepostgresql.org...
irc#postgresql

2 users in discussion

Neil Conway: 2 posts Tom Lane: 1 post

People

Translate

site design / logo © 2022 Grokbase