Re: Tab completion for AT TIME ZONE - Mailing list pgsql-hackers

From Jim Jones
Subject Re: Tab completion for AT TIME ZONE
Date
Msg-id e88d2f9a-42ba-c19f-cfa1-28731ab4396a@uni-muenster.de
Whole thread Raw
In response to Re: Tab completion for AT TIME ZONE  (Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>)
Responses Re: Tab completion for AT TIME ZONE  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
On 14.04.23 11:29, Dagfinn Ilmari Mannsåker wrote:
> It doesn't tab complete the AT TIME ZONE operator itself, just the
> timezone name after it, so this sholud work:
>
>      # SELECT now() AT TIME ZONE <tab><tab>
>
> or
>
>      # SELECT now() AT TIME ZONE am<tab>
>
>
> However, looking more closely at the grammar, the word AT only occurs in
> AT TIME ZONE, so we could complete the operator itself as well.  Updated
> patch attatched.
>
>> Best, Jim
> - ilmari

Got it.

In that case, everything seems to work just fine:

postgres=# SELECT now() AT <tab>

.. autocompletes TIME ZONE :

postgres=# SELECT now() AT TIME ZONE


postgres=# SELECT now() AT TIME ZONE <tab><tab>
Display all 598 possibilities? (y or n)


postgres=# SELECT now() AT TIME ZONE 'Europe/Is<tab><tab>
Europe/Isle_of_Man  Europe/Istanbul


also neglecting the opening single quotes ...

postgres=# SELECT now() AT TIME ZONE Europe/Is<tab>

... autocompletes it after <tab>:

postgres=# SELECT now() AT TIME ZONE 'Europe/Is


The patch applies cleanly and it does what it is proposing. - and it's 
IMHO a very nice addition.

I've marked the CF entry as "Ready for Committer".

Jim




pgsql-hackers by date:

Previous
From: Dagfinn Ilmari Mannsåker
Date:
Subject: Re: Adding argument names to aggregate functions
Next
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: [PoC] pg_upgrade: allow to upgrade publisher node