pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Tab completion for SET TimeZone
Date: Sun, 20 Mar 2022 16:11:03 -0400
Message-ID: <1576631.1647807063@sss.pgh.pa.us> (raw)
In-Reply-To: <877d8os8wh.fsf@wibble.ilmari.org>
References: <87k0curq0w.fsf@wibble.ilmari.org>
	<87h77yrpsu.fsf@wibble.ilmari.org>
	<514658.1647438049@sss.pgh.pa.us>
	<87czikrtc1.fsf@wibble.ilmari.org>
	<87a6dnsgyr.fsf@wibble.ilmari.org>
	<1157472.1647629584@sss.pgh.pa.us>
	<877d8os8wh.fsf@wibble.ilmari.org>

=?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= <ilmari@ilmari.org> writes:
> Tom Lane <tgl@sss.pgh.pa.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





view thread (10+ messages)  latest in thread

Message-ID: <1576631.1647807063@sss.pgh.pa.us>
Permalink:  ../1576631.1647807063@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1576631.1647807063@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ilmari@ilmari.org
  Subject: Re: Tab completion for SET TimeZone
  In-Reply-To: <1576631.1647807063@sss.pgh.pa.us>
  References: <87k0curq0w.fsf@wibble.ilmari.org> <87h77yrpsu.fsf@wibble.ilmari.org> <514658.1647438049@sss.pgh.pa.us> <87czikrtc1.fsf@wibble.ilmari.org> <87a6dnsgyr.fsf@wibble.ilmari.org> <1157472.1647629584@sss.pgh.pa.us> <877d8os8wh.fsf@wibble.ilmari.org> <1576631.1647807063@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox