Re: Getting PSQL in Windows to support TAB/Autocomplete via modified readline...

From: Kirk Wolak <wolakk(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Getting PSQL in Windows to support TAB/Autocomplete via modified readline...
Date: 2022-11-24 02:04:25
Message-ID: CACLU5mRRLAW2kca3k2gVDM8kow6wgvT_BCaeg37jz=Kyj1afvw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Nov 23, 2022 at 7:41 PM Andres Freund <andres(at)anarazel(dot)de> wrote:

> Hi,
>
> On 2022-11-23 18:11:22 -0500, Tom Lane wrote:
> > Andres Freund <andres(at)anarazel(dot)de> writes:
> > > On 2022-11-21 10:58:06 -0500, Tom Lane wrote:
> > >> It'd certainly be nice if we could use Readline on Windows.
>
> So It might just be that we need to split up that very long "else if"
> chain in
> psql_completion().
> Andres Freund
>

That's exactly what I did:
int if_continues = 0; // declared at the top

Circa Line 3,900
else
if_continues = 1; // break huge if
if (if_continues == 0)
NULL;
else ... // This else picks up here again

and you could replace the NULL with if_continues = 0; to allow breaking it
again in the future with the same variable.
I've never seen a single statement that long...

Regards Kirk

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Rowley 2022-11-24 02:13:37 Re: table inheritance partition and indexes
Previous Message Kirk Wolak 2022-11-24 01:55:18 Re: Getting PSQL in Windows to support TAB/Autocomplete via modified readline...