Re: Tab completion for AT TIME ZONE

From: Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org>
To: Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Tab completion for AT TIME ZONE
Date: 2023-04-14 09:29:49
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi Jim,

Thanks for having a look at my patch, but please don't top post on
PostgreSQL lists.

Jim Jones <jim(dot)jones(at)uni-muenster(dot)de> writes:

> Hi,
> On 12.04.23 19:53, Dagfinn Ilmari Mannsåker wrote:
>> Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org> writes:
>>> Hi hackers,
>>> A while back we added support for completing time zone names after SET
>>> TIMEZONE, but we failed to do the same for the AT TIME ZONE operator.
>>> Here's a trivial patch for that.
> Is this supposed to provide tab completion for the AT TIME ZONE operator
> like in this query?
> SELECT '2023-04-14 08:00:00' AT TIME ZONE 'Europe/Lisbon';
> The patch applied cleanly but I'm afraid I cannot reproduce the intended
> behaviour:
> postgres=# SELECT '2023-04-14 08:00:00' AT<tab>
> postgres=# SELECT '2023-04-14 08:00:00' AT T<tab>
> postgres=# SELECT '2023-04-14 08:00:00' AT TIME Z<tab>
> Perhaps I'm testing it in the wrong place?

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>


# 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

Attachment Content-Type Size
v2-0001-psql-tab-completion-for-AT-TIME-ZONE.patch text/x-diff 1.2 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2023-04-14 09:59:06 Re: Issue in postgres_fdw causing unnecessary wait for cancel request reply
Previous Message Jim Jones 2023-04-14 09:12:24 Re: Adding argument names to aggregate functions