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

2024-10-07 Thread Thomas Munro
Hi Kirk, Just as an FYI since you were working in this area, Tom has just knocked off one of the blockers for tab completion on Windows, namely that MSVC didn't like the overgrown if-then-else code in tab-complete.c[1]. That is now fixed in PostgreSQL's master branch[2][3][4] (v18 to be). [1] h

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

2022-12-23 Thread Andres Freund
Hi, On 2022-12-08 09:52:52 -0500, Kirk Wolak wrote: > On Wed, Dec 7, 2022 at 2:18 PM Andres Freund wrote: > > > Hi, > > > > On 2022-11-28 17:22:19 -0500, Kirk Wolak wrote: > > > Thank you for this. We have the build working with meson (w/o > > readline). > > > I was not able to get "readline"

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

2022-12-08 Thread Kirk Wolak
On Wed, Dec 7, 2022 at 2:18 PM Andres Freund wrote: > Hi, > > On 2022-11-28 17:22:19 -0500, Kirk Wolak wrote: > > Thank you for this. We have the build working with meson (w/o > readline). > > I was not able to get "readline" to be recognized by meson (I've attached > > the log file) > > I

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

2022-12-07 Thread Andres Freund
Hi, On 2022-11-28 17:22:19 -0500, Kirk Wolak wrote: > Thank you for this. We have the build working with meson (w/o readline). > I was not able to get "readline" to be recognized by meson (I've attached > the log file) > It is "there" according to vcpkg. (other projects have a .pc file thi

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

2022-11-25 Thread Kirk Wolak
On Tue, Nov 22, 2022 at 5:51 PM Thomas Munro wrote: > On Tue, Nov 22, 2022 at 4:25 AM Kirk Wolak wrote: > > In researching this problem, it appears that the decision was made > like 17yrs ago, when windows did not have a realistic "terminal" type > interface. > > FWIW PostgreSQL 16 will requir

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

2022-11-23 Thread Kirk Wolak
On Wed, Nov 23, 2022 at 9:57 PM Tom Lane wrote: > Andres Freund writes: > > I think it'd be easier to deal with this if COMPLETE_WITH_* caused the > the > > containing function to return. Then the completions wouldn't need to be > in one > > huge if-else if. Leaving msvc aside, that also seems n

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

2022-11-23 Thread Kirk Wolak
On Wed, Nov 23, 2022 at 9:32 PM Andres Freund wrote: > Hi, > > On 2022-11-23 20:55:18 -0500, Kirk Wolak wrote: > > Currently I have a lot of it working, but I need to partner up with some > of > > the meson guys... > > if it is already close to working, a couple of my tweaks could accelerate > >

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

2022-11-23 Thread Tom Lane
Andres Freund writes: > I think it'd be easier to deal with this if COMPLETE_WITH_* caused the the > containing function to return. Then the completions wouldn't need to be in one > huge if-else if. Leaving msvc aside, that also seems nice for efficiency. Yeah, that could be an easy quick-fix. W

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

2022-11-23 Thread Andres Freund
Hi, On 2022-11-23 20:55:18 -0500, Kirk Wolak wrote: > Currently I have a lot of it working, but I need to partner up with some of > the meson guys... > if it is already close to working, a couple of my tweaks could accelerate > it. I just successfully compiled postgres with meson and readline, us

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

2022-11-23 Thread Andres Freund
Hi, On 2022-11-23 20:28:29 -0500, Tom Lane wrote: > Andres Freund writes: > > On 2022-11-23 18:11:22 -0500, Tom Lane wrote: > >> Huh ... do you recall the details? Large as tab-complete is, it's > >> far smaller than gram.y: > > > So It might just be that we need to split up that very long "else

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

2022-11-23 Thread Kirk Wolak
On Wed, Nov 23, 2022 at 7:41 PM Andres Freund wrote: > Hi, > > On 2022-11-23 18:11:22 -0500, Tom Lane wrote: > > Andres Freund 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 sp

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

2022-11-23 Thread Kirk Wolak
On Wed, Nov 23, 2022 at 6:11 PM Tom Lane wrote: > Andres Freund writes: > > On 2022-11-21 10:58:06 -0500, Tom Lane wrote: > >> It'd certainly be nice if we could use Readline on Windows. > > > 2) The last time I checked, msvc couldn't preprocess tab-complete.c with > >USE_READLINE defined, d

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

2022-11-23 Thread Tom Lane
Andres Freund writes: > On 2022-11-23 18:11:22 -0500, Tom Lane wrote: >> Huh ... do you recall the details? Large as tab-complete is, it's >> far smaller than gram.y: > So It might just be that we need to split up that very long "else if" chain in > psql_completion(). Could be, yeah. Related p

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

2022-11-23 Thread Andres Freund
Hi, On 2022-11-23 18:11:22 -0500, Tom Lane wrote: > Andres Freund writes: > > On 2022-11-21 10:58:06 -0500, Tom Lane wrote: > >> It'd certainly be nice if we could use Readline on Windows. > > > 2) The last time I checked, msvc couldn't preprocess tab-complete.c with > >USE_READLINE defined,

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

2022-11-23 Thread Tom Lane
Andres Freund writes: > On 2022-11-21 10:58:06 -0500, Tom Lane wrote: >> It'd certainly be nice if we could use Readline on Windows. > 2) The last time I checked, msvc couldn't preprocess tab-complete.c with >USE_READLINE defined, due to running into some preprocessor limits. We can >prob

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

2022-11-23 Thread Andres Freund
hi, On 2022-11-21 10:58:06 -0500, Tom Lane wrote: > Kirk Wolak writes: > > We have our team of Windows developers, leveraging PSQL. But honestly, > > it feels crippled after using PSQL in Linux for any length of time. Losing > > auto-complete sucks (multi-line query recall/editing is lost as

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

2022-11-23 Thread Kirk Wolak
On Wed, Nov 23, 2022 at 6:56 AM Karsten Hilbert wrote: > Am Tue, Nov 22, 2022 at 11:59:59PM -0500 schrieb Kirk Wolak: > > > > It's OK to post a work-in-progress patch to pgsql-hackers, even if it > > > src/bin/psql/t/010_tab_completion.pl pass on Windows, but if that's > > > hard, don't let that

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

2022-11-23 Thread Laurenz Albe
On Wed, 2022-11-23 at 12:56 +0100, Karsten Hilbert wrote: > Am Tue, Nov 22, 2022 at 11:59:59PM -0500 schrieb Kirk Wolak: > > > > It's OK to post a work-in-progress patch to pgsql-hackers, even if it > > > doesn't work right yet.  With any luck, people will show up to help > > > with problems.  I a

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

2022-11-23 Thread Karsten Hilbert
Am Tue, Nov 22, 2022 at 11:59:59PM -0500 schrieb Kirk Wolak: > > It's OK to post a work-in-progress patch to pgsql-hackers, even if it > > doesn't work right yet. With any luck, people will show up to help > > with problems. I am 100% sure that our Windows user community would > > love this feat

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

2022-11-22 Thread Kirk Wolak
On Tue, Nov 22, 2022 at 5:51 PM Thomas Munro wrote: > On Tue, Nov 22, 2022 at 4:25 AM Kirk Wolak wrote: > > In researching this problem, it appears that the decision was made > like 17yrs ago, when windows did not have a realistic "terminal" type > interface. Assuming we target Windows 8.1 or

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

2022-11-22 Thread Kirk Wolak
On Mon, Nov 21, 2022 at 1:10 PM Dominique Devienne wrote: > On Mon, Nov 21, 2022 at 6:12 PM Kirk Wolak wrote: > > On Mon, Nov 21, 2022 at 11:01 AM Dominique Devienne > wrote: > > > FWIW, I've been using https://github.com/arangodb/linenoise-ng for > Linux and Windows, > > > > I've look at linen

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

2022-11-22 Thread Thomas Munro
On Tue, Nov 22, 2022 at 4:25 AM Kirk Wolak wrote: > In researching this problem, it appears that the decision was made like > 17yrs ago, when windows did not have a realistic "terminal" type interface. > Assuming we target Windows 8.1 or higher, I believe this goes away. FWIW PostgreSQL 16 w

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

2022-11-21 Thread Dominique Devienne
On Mon, Nov 21, 2022 at 6:12 PM Kirk Wolak wrote: > On Mon, Nov 21, 2022 at 11:01 AM Dominique Devienne > wrote: > > FWIW, I've been using https://github.com/arangodb/linenoise-ng for Linux > > and Windows, > > I've look at linenoise and without tab/autocomplete it's not worth the > effort, IM

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

2022-11-21 Thread Kirk Wolak
On Mon, Nov 21, 2022 at 10:58 AM Tom Lane wrote: > It'd certainly be nice if we could use Readline on Windows. I do not > think we want to buy into maintaining our own fork of Readline, if that's > what you're trying to suggest. If it "just works" now, that'd be great. > Okay, we should know s

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

2022-11-21 Thread Dominique Devienne
On Mon, Nov 21, 2022 at 4:58 PM Tom Lane wrote: > Kirk Wolak writes: > > We have our team of Windows developers, leveraging PSQL. But honestly, > > it feels crippled after using PSQL in Linux for any length of time. Losing > > auto-complete sucks (multi-line query recall/editing is lost as we

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

2022-11-21 Thread Tom Lane
Kirk Wolak writes: > We have our team of Windows developers, leveraging PSQL. But honestly, > it feels crippled after using PSQL in Linux for any length of time. Losing > auto-complete sucks (multi-line query recall/editing is lost as well). > In researching this problem, it appears that th

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

2022-11-21 Thread Kirk Wolak
First, I wanted to send this to the developers (hackers) list. But the instructions are clear that initial posts don't go there (try elsewhere first). So playing by the rules here... *Background:* We have our team of Windows developers, leveraging PSQL. But honestly, it feels crippled after