Thanks for taking a look!
On Wed, Mar 12, 2025 at 11:50 AM Daniel Westermann (DWE)
<daniel.westermann@dbi-services.com> wrote:
>
>
> great, thanks for this. One question:
>
> >The current log_connections options are 'receipt', 'authentication', and
> >'authorization'. The empty string disables all connection logging. 'all'
> >enables all available connection logging.
>
> ... shouldn't this be added to tab completion as well?
>
> postgres=# alter system set log_connections TO DEFAULT
Because it is now a string GUC, there isn't a facility for tab
completion. Enum and boolean GUCs have a defined set of options which
can be provided as options for tab completion. Because string GUCs
don't have to have a set of defined options, they don't have tab
completion (AFAIK). For example, you couldn't have a defined set of
options for log_line_prefix.
There are a subset of the string GUCs that do have predefined options
which they validate in their check hooks. Many of these are GUCs which
can accept some combination of options -- so they don't fit well into
the enum GUC type (for example, debug_io_direct).
While writing this feature, I did consider if we should add a new GUC
type PGC_SET [1] which would back GUCs that accept any subset of a
predefined set of options. This would allow us to have tab completion.
I didn't end up doing this because I felt tab completion was the only
advantage it would provide this patch and it would be a big code
change, but it is definitely something to consider in the future.
- Melanie
[1] https://www.postgresql.org/message-id/CAAKRu_a5-7sUP%2BQ6YD5emQYS1w7ffBDUNf-NMbcxR-dpOdGehw%40mail.gmail.com