Re: Tab completion for SET TimeZone

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Tab completion for SET TimeZone
Date: 2022-03-20 20:11:03
Message-ID: 1576631.1647807063@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

=?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= <ilmari(at)ilmari(dot)org> writes:
> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
>> I think the reason the COMPLETE_WITH_ENUM_VALUE macro doesn't look
>> similar is that it hasn't made an attempt to work with input that
>> the user didn't quote --- that is, if you type
>> alter type planets rename value ur<TAB>
>> it just fails to match anything, instead of providing "'uranus'".
>> Should we upgrade that likewise?`

> The comment says it will add the quote before text if it's not there, so
> maybe we should adjust that to say that it will only add the quote if
> the user hasn't typed anything?

After thinking a bit harder, I realized that the SchemaQuery
infrastructure has no way to deal with the case of the input text not
being a prefix of what we want the output to be, so it can't do something
comparable to Query_for_list_of_timezone_names_quoted_out. Maybe someday
we'll feel like adding that, but COMPLETE_WITH_ENUM_VALUE isn't a
compelling enough reason in current usage. So I just tweaked the comment
a bit.

Pushed that way.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Matthias van de Meent 2022-03-20 20:12:17 Re: Hardening heap pruning code (was: BUG #17255: Server crashes in index_delete_sort_cmp() due to race condition with vacuum)
Previous Message Dagfinn Ilmari Mannsåker 2022-03-20 19:47:58 Re: Tab completion for SET TimeZone