Re: Tab completion for SET TimeZone

2022-03-20 Thread Dagfinn Ilmari Mannsåker
Tom Lane writes: > 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

Re: Tab completion for SET TimeZone

2022-03-20 Thread Tom Lane
=?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= writes: > Tom Lane 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

Re: Tab completion for SET TimeZone

2022-03-20 Thread Dagfinn Ilmari Mannsåker
Tom Lane writes: > =?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= writes: >> I just realised there's no point in the subselect when I'm not applying >> the same function in the WHERE and the SELECT, so here's an updated >> version that simplifies that. It also fixes a typo in the commit >> message.

Re: Tab completion for SET TimeZone

2022-03-18 Thread Tom Lane
... btw, I forgot to mention that I don't see any problem with the patch's behavior for DEFAULT. What I see with both readline and libedit is that if you type something reasonable, like set timezone to d then it will correctly complete "efault ", without any extra quotes. Now, if you're

Re: Tab completion for SET TimeZone

2022-03-18 Thread Tom Lane
=?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= writes: > I just realised there's no point in the subselect when I'm not applying > the same function in the WHERE and the SELECT, so here's an updated > version that simplifies that. It also fixes a typo in the commit > message. This doesn't work right

Re: Tab completion for SET TimeZone

2022-03-18 Thread Dagfinn Ilmari Mannsåker
Dagfinn Ilmari Mannsåker writes: > Tom Lane writes: > >> Also, personally, I'd rather not smash the names to lower case. >> I think that's a significant decrement of readability. > > That was mainly for convenience of not having to capitalise the place > names when typing (since they are

Re: Tab completion for SET TimeZone

2022-03-17 Thread Dagfinn Ilmari Mannsåker
Tom Lane writes: > =?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= writes: >> I just noticed I left out the = in the match check, here's an updated >> patch that fixes that. > > Hmm is that actually going to be useful in that form? > Most time zone names contain slashes and will therefore

Re: Tab completion for SET TimeZone

2022-03-16 Thread Tom Lane
=?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= writes: > I just noticed I left out the = in the match check, here's an updated > patch that fixes that. Hmm is that actually going to be useful in that form? Most time zone names contain slashes and will therefore require single-quoting. I think

Re: Tab completion for SET TimeZone

2022-03-16 Thread Dagfinn Ilmari Mannsåker
Dagfinn Ilmari Mannsåker writes: > Hi hackers, > > I noticed there was no tab completion for time zones in psql, so here's > a patch that implements that. I just noticed I left out the = in the match check, here's an updated patch that fixes that. - ilmari >From

Tab completion for SET TimeZone

2022-03-16 Thread Dagfinn Ilmari Mannsåker
Hi hackers, I noticed there was no tab completion for time zones in psql, so here's a patch that implements that. I chose lower-casing the names since they are case insensitive, and verbatim since ones without slashes can be entered without quotes, and (at least my version of) readline completes