Re: psql: Allow editing query results with \gedit

2024-05-17 Thread Robert Haas
On Fri, May 17, 2024 at 9:24 AM Christoph Berg wrote: > Tom> The stated complaint was "it's too hard to build UPDATE commands", > Tom> which I can sympathize with. > > ... which this would perfectly address - it's building the commands. > > The editor will have a bit more clutter (the UPDATE SET

Re: psql: Allow editing query results with \gedit

2024-05-17 Thread Christoph Berg
Re: Robert Haas > Based on these comments and the one from David Johnston, I think there > is a consensus that we do not want this patch, so I'm marking it as > Rejected in the CommitFest application. If I've misunderstood the > situation, then please feel free to change the status accordingly.

Re: psql: Allow editing query results with \gedit

2024-05-14 Thread Robert Haas
On Mon, Jan 22, 2024 at 11:15 AM Tom Lane wrote: > > Introduction of \gedit is interesting idea, but in this form it looks too > > magic > > Yeah, I don't like it either --- it feels like something that belongs > in an ETL tool not psql. The sheer size of the patch shows how far > afield it is

Re: psql: Allow editing query results with \gedit

2024-01-23 Thread Pavel Stehule
út 23. 1. 2024 v 11:38 odesílatel Christoph Berg napsal: > Re: Pavel Stehule > > It looks great for simple queries, but if somebody uses it like SELECT * > > FROM pg_proc \gedit > > What's wrong with that? If the pager can handle the amount of data, > the editor can do that as well. (If not, the

Re: psql: Allow editing query results with \gedit

2024-01-23 Thread Christoph Berg
Re: Pavel Stehule > It looks great for simple queries, but if somebody uses it like SELECT * > FROM pg_proc \gedit What's wrong with that? If the pager can handle the amount of data, the editor can do that as well. (If not, the fix is to just not run the command, and not blame the feature.) > I

Re: psql: Allow editing query results with \gedit

2024-01-22 Thread Pavel Stehule
po 22. 1. 2024 v 23:54 odesílatel Christoph Berg napsal: > Re: David G. Johnston > > Building off the other comments, I'd suggest trying to get rid of the > > intermediate JSOn format and also just focus on a single row at any given > > time. > > We need *some* machine-readable format. It

Re: psql: Allow editing query results with \gedit

2024-01-22 Thread Christoph Berg
Re: David G. Johnston > Building off the other comments, I'd suggest trying to get rid of the > intermediate JSOn format and also just focus on a single row at any given > time. We need *some* machine-readable format. It doesn't have to be JSON, but JSON is actually pretty nice to read - and if

Re: psql: Allow editing query results with \gedit

2024-01-22 Thread Christoph Berg
Re: Pavel Stehule > Introduction of \gedit is interesting idea, but in this form it looks too > magic > > a) why the data are in JSON format, that is not native for psql (minimally > now) Because we need something machine-readable. CSV would be an alternative, but that is hardly human-readable.

Re: psql: Allow editing query results with \gedit

2024-01-22 Thread Tom Lane
Pavel Stehule writes: > I would have forms like FoxPro, I would have a grid like FoxPro, but not in > psql, and I would not develop it :-) Yeah, that's something that was also bothering me, but I failed to put my finger on it. "Here's some JSON, edit it, and don't forget to keep the quoting

Re: psql: Allow editing query results with \gedit

2024-01-22 Thread Pavel Stehule
po 22. 1. 2024 v 17:34 odesílatel David G. Johnston < david.g.johns...@gmail.com> napsal: > On Mon, Jan 22, 2024 at 8:06 AM Christoph Berg wrote: > >> Assuming a SELECT statement reading from a single table, it is quite an >> effort to transform that statement to an UPDATE statement on that

Re: psql: Allow editing query results with \gedit

2024-01-22 Thread David G. Johnston
On Mon, Jan 22, 2024 at 8:06 AM Christoph Berg wrote: > Assuming a SELECT statement reading from a single table, it is quite an > effort to transform that statement to an UPDATE statement on that table, > perhaps to fix a typo that the user has spotted in the query result. > > Building off the

Re: psql: Allow editing query results with \gedit

2024-01-22 Thread Tom Lane
Pavel Stehule writes: > po 22. 1. 2024 v 16:06 odesílatel Christoph Berg napsal: >> This patch automates the tedious parts by opening the query result in a >> editor in JSON format, where the user can edit the data. On closing the >> editor, the JSON data is read back, and the differences are

Re: psql: Allow editing query results with \gedit

2024-01-22 Thread Pavel Stehule
Hi po 22. 1. 2024 v 16:06 odesílatel Christoph Berg napsal: > Assuming a SELECT statement reading from a single table, it is quite an > effort to transform that statement to an UPDATE statement on that table, > perhaps to fix a typo that the user has spotted in the query result. > > First, the

psql: Allow editing query results with \gedit

2024-01-22 Thread Christoph Berg
ded JSON format, best suitable for long values. This patch requires the "psql JSON output format" patch. Christoph >From be3fef72af0adac7d3a6962f8cc78e167785a702 Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Mon, 22 Jan 2024 14:40:33 +0100 Subject: [PATCH] psql: Allow edit