Re: [PATCH] Tab completion for ALTER DATABASE … SET TABLESPACE

2018-09-21 Thread Andres Freund
Hi, On 2018-09-22 09:56:00 +1200, Thomas Munro wrote: > I vote for doing it this way then. It may turn out to be useful for > efficient SearchSysCache(...), DirectFunctionCall(...) and other > things like that. Yea, especially the *FunctionCall* stuff is awfully verbose. I also wonder if it

Re: [PATCH] Tab completion for ALTER DATABASE … SET TABLESPACE

2018-09-21 Thread Andres Freund
Hi, On 2018-09-21 19:27:48 -0400, Tom Lane wrote: > > You earlier were talking about tackling this - do you still want to? I > > can otherwise, but it'll not be today, but likely tomorrow. > > On it now. Thanks, looks good. msvc and icc are, as expected, ok too. Greetings, Andres Freund

Re: [PATCH] Tab completion for ALTER DATABASE … SET TABLESPACE

2018-09-21 Thread Tom Lane
Andres Freund writes: > On 2018-09-21 18:00:35 -0400, Tom Lane wrote: >> If you want to rename it, then to what? VA_ARGS_NARGS, perhaps? > I like your suggestion. I mainly didn't like the PP_ prefix. Sold. The original author overcomplicated it anyway; I now have /* * VA_ARGS_NARGS *

Re: [PATCH] Tab completion for ALTER DATABASE … SET TABLESPACE

2018-09-21 Thread Andres Freund
On 2018-09-21 18:00:35 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2018-09-22 09:15:27 +1200, Thomas Munro wrote: > >> On Sat, Sep 22, 2018 at 8:51 AM Andres Freund wrote: > >>> I think there's some argument to be made about the "mental" complexity > >>> of the macros - if we went for

Re: [PATCH] Tab completion for ALTER DATABASE … SET TABLESPACE

2018-09-21 Thread Tom Lane
Andres Freund writes: > On 2018-09-22 09:15:27 +1200, Thomas Munro wrote: >> On Sat, Sep 22, 2018 at 8:51 AM Andres Freund wrote: >>> I think there's some argument to be made about the "mental" complexity >>> of the macros - if we went for them, we'd certainly need to add some >>> docs about how

Re: [PATCH] Tab completion for ALTER DATABASE … SET TABLESPACE

2018-09-21 Thread Thomas Munro
On Sat, Sep 22, 2018 at 9:46 AM Andres Freund wrote: > On 2018-09-22 09:15:27 +1200, Thomas Munro wrote: > > On Sat, Sep 22, 2018 at 8:51 AM Andres Freund wrote: > > > I think there's some argument to be made about the "mental" complexity > > > of the macros - if we went for them, we'd certainly

Re: [PATCH] Tab completion for ALTER DATABASE … SET TABLESPACE

2018-09-21 Thread Andres Freund
Hi, On 2018-09-22 09:15:27 +1200, Thomas Munro wrote: > On Sat, Sep 22, 2018 at 8:51 AM Andres Freund wrote: > > I think there's some argument to be made about the "mental" complexity > > of the macros - if we went for them, we'd certainly need to add some > > docs about how they work. One

Re: [PATCH] Tab completion for ALTER DATABASE … SET TABLESPACE

2018-09-21 Thread Thomas Munro
On Sat, Sep 22, 2018 at 8:51 AM Andres Freund wrote: > I think there's some argument to be made about the "mental" complexity > of the macros - if we went for them, we'd certainly need to add some > docs about how they work. One argument for having PP_NARGS (renamed) is > that it doesn't seem

Re: [PATCH] Tab completion for ALTER DATABASE … SET TABLESPACE

2018-09-21 Thread Andres Freund
Hi, On 2018-09-21 16:20:42 -0400, Tom Lane wrote: > Thomas Munro writes: > > On Fri, Sep 21, 2018 at 5:52 PM Andres Freund wrote: > >> Here's a very quick-and-dirty implementation of this approach. Some very > >> very brief testing seems to indicate it works, although I'm sure not > >>

Re: Re: [PATCH] Tab completion for ALTER DATABASE … SET TABLESPACE

2018-09-21 Thread Tom Lane
Thomas Munro writes: > On Fri, Sep 21, 2018 at 5:52 PM Andres Freund wrote: >> Here's a very quick-and-dirty implementation of this approach. Some very >> very brief testing seems to indicate it works, although I'm sure not >> perfectly. > And here is a quick-and-dirty variadic

Re: [PATCH] Tab completion for ALTER DATABASE … SET TABLESPACE

2018-09-20 Thread Andres Freund
On 2018-09-20 16:19:26 -0700, Andres Freund wrote: > On 2018-09-20 19:03:16 -0400, Tom Lane wrote: > > Andres Freund writes: > > > On 2018-09-20 18:38:36 -0400, Tom Lane wrote: > > >> hmmm ... but even with variadic, C's macro facility is so weak that > > >> I'm not sure we can reimplement these

Re: [PATCH] Tab completion for ALTER DATABASE … SET TABLESPACE

2018-09-20 Thread Andres Freund
On 2018-09-20 19:03:16 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2018-09-20 18:38:36 -0400, Tom Lane wrote: > >> hmmm ... but even with variadic, C's macro facility is so weak that > >> I'm not sure we can reimplement these with it. What would the > >> expansion look like? > > >

Re: [PATCH] Tab completion for ALTER DATABASE … SET TABLESPACE

2018-09-20 Thread Tom Lane
Andres Freund writes: > On 2018-09-20 18:38:36 -0400, Tom Lane wrote: >> hmmm ... but even with variadic, C's macro facility is so weak that >> I'm not sure we can reimplement these with it. What would the >> expansion look like? > There's a dirty hack to count arguments in vararg macros: >

Re: [PATCH] Tab completion for ALTER DATABASE … SET TABLESPACE

2018-09-20 Thread Andres Freund
On 2018-09-20 18:38:36 -0400, Tom Lane wrote: > Thomas Munro writes: > > . o O ( hmm, we now have variadic macros ) > > hmmm ... but even with variadic, C's macro facility is so weak that > I'm not sure we can reimplement these with it. What would the > expansion look like? There's a dirty

Re: Re: [PATCH] Tab completion for ALTER DATABASE … SET TABLESPACE

2018-09-20 Thread Tom Lane
Thomas Munro writes: > . o O ( hmm, we now have variadic macros ) hmmm ... but even with variadic, C's macro facility is so weak that I'm not sure we can reimplement these with it. What would the expansion look like? (It constantly annoys me that C's so weak here. In the language I used for

Re: [PATCH] Tab completion for ALTER DATABASE … SET TABLESPACE

2018-09-20 Thread Thomas Munro
On Fri, Sep 21, 2018 at 9:22 AM Tom Lane wrote: > Arthur Zakirov writes: > > On Thu, Aug 30, 2018 at 05:54:23PM +0100, Dagfinn Ilmari Mannsåker wrote: > >> And just after hitting send, I noticed I'd typed ALTER TABLE instead of > >> ALTER DATABASE, including in the commit message :( > >> Fixed

Re: [PATCH] Tab completion for ALTER DATABASE … SET TABLESPACE

2018-09-20 Thread Tom Lane
Arthur Zakirov writes: > On Thu, Aug 30, 2018 at 05:54:23PM +0100, Dagfinn Ilmari Mannsåker wrote: >> And just after hitting send, I noticed I'd typed ALTER TABLE instead of >> ALTER DATABASE, including in the commit message :( >> Fixed patch attached. > The patch seems reasonable. It fixes the

Re: [PATCH] Tab completion for ALTER DATABASE … SET TABLESPACE

2018-09-14 Thread Arthur Zakirov
On Thu, Aug 30, 2018 at 05:54:23PM +0100, Dagfinn Ilmari Mannsåker wrote: > ilm...@ilmari.org (Dagfinn Ilmari Mannsåker) writes: > > Hi hackers, > > > > I just noticed that psql's tab completion for ALTER TABLE … SET > > TABLESPACE was treating it as any other configuration parameter and > >

Re: [PATCH] Tab completion for ALTER DATABASE … SET TABLESPACE

2018-09-03 Thread Arthur Zakirov
Hello, On Thu, Aug 30, 2018 at 05:54:23PM +0100, Dagfinn Ilmari Mannsåker wrote: > ilm...@ilmari.org (Dagfinn Ilmari Mannsåker) writes: > > Hi hackers, > > > > I just noticed that psql's tab completion for ALTER TABLE … SET > > TABLESPACE was treating it as any other configuration parameter and >

Re: [PATCH] Tab completion for ALTER DATABASE … SET TABLESPACE

2018-08-30 Thread Dagfinn Ilmari Mannsåker
ilm...@ilmari.org (Dagfinn Ilmari Mannsåker) writes: > Hi hackers, > > I just noticed that psql's tab completion for ALTER TABLE … SET > TABLESPACE was treating it as any other configuration parameter and > completing with FROM DEFAULT or TO after it, instead of a list of > tablespaces. And just