Re: External psql editor

2022-04-29 Thread Rich Shepard
On Fri, 29 Apr 2022, Jan Wieck wrote: What you are missing is that even though the PSQL_EDITOR env variable is set, psql itself doesn't emulate that editor's behavior natively. You need to actually launch the editor (possibly while having a partial query in the buffer) with the \e command.

Re: External psql editor

2022-04-29 Thread Rich Shepard
On Fri, 29 Apr 2022, Francisco Olarte wrote: I do a similar thing, but normally edit queries in an editor window and just use selection or clipboard to paste them into the xterm where I have psql running. I also used joe a lot ( its key sequences where easy coming from wordstar(cp/m->msdos) ).

Re: External psql editor

2022-04-29 Thread Jan Wieck
On 4/29/22 13:13, Rich Shepard wrote: While in psql, type \e and Enter. You will have the current query buffer in the editor. You can do this at the end of a partial (not yet semicolon terminated) query. Can I set it before entering any command or better yet, when I invoke psql? Not that I

Re: Mail list manager request

2022-04-29 Thread Kris Deugau
Rich Shepard wrote: Looking at the postgresql.org web site I could not find the mail list manager for direct contact so I apologize for writing here. I use procmail to sort incoming messages to the proper file. Messages from the mail list come with varying information at the bottom of the

Mail list manager request

2022-04-29 Thread Rich Shepard
Looking at the postgresql.org web site I could not find the mail list manager for direct contact so I apologize for writing here. I use procmail to sort incoming messages to the proper file. Messages from the mail list come with varying information at the bottom of the headers; it could be

Re: External psql editor

2022-04-29 Thread Rich Shepard
On Fri, 29 Apr 2022, Jan Wieck wrote: Not that I know of. \e starts the external editor and you have to save and exit that editor to get back to psql in order to execute it. IMHO the whole construct has very limited usability. Jan, I tried, unsuccessily, to use \e. Entering it while a

Re: External psql editor

2022-04-29 Thread Rich Shepard
On Fri, 29 Apr 2022, Rich Shepard wrote: ... probably C-x will do the job. Actually, it's C-k x, the usual joe save command. My thanks to all because this new skill is saving me much time and effort. Regards, Rich

Re: External psql editor

2022-04-29 Thread Rich Shepard
On Fri, 29 Apr 2022, David G. Johnston wrote: You type "insert", realize you want an editor for this, hit enter (multi-line mode is psql), type \e, hit enter again, your editor appears with "insert" already in place from the query buffer. Upon returning you are given a new buffer with the

Re: External psql editor

2022-04-29 Thread Rich Shepard
On Fri, 29 Apr 2022, Jan Wieck wrote: It is the other way around, like in postgres-# select now()\e Jan, That does make a difference. Now I'm learning how to end the edit and return from joe to the psql shell. The [Enter] key wraps the long line; probably C-x will do the job. Many thanks,

Re: External psql editor

2022-04-29 Thread Adrian Klaver
On 4/29/22 12:50 PM, Mladen Gogala wrote: On 4/29/22 13:35, Jan Wieck wrote: Not that I know of. \e starts the external editor and you have to save and exit that editor to get back to psql in order to execute it. IMHO the whole construct has very limited usability. Regards, Jan Is there

Re: External psql editor

2022-04-29 Thread Mladen Gogala
On 4/29/22 13:35, Jan Wieck wrote: Not that I know of. \e starts the external editor and you have to save and exit that editor to get back to psql in order to execute it. IMHO the whole construct has very limited usability. Regards, Jan Is there a way to define the name of the temporary

Re: External psql editor

2022-04-29 Thread Jan Wieck
On 4/29/22 15:50, Mladen Gogala wrote: Is there a way to define the name of the temporary file created by \e command? I'd like to name it "afiedt.buf", not for sentimental reasons. I already have a cron job that cleans afiedt.buf from my home directory every hour and having psql name temporary

Re: External psql editor

2022-04-29 Thread Rich Shepard
On Fri, 29 Apr 2022, Jan Wieck wrote: Did you hit Enter after \e ? Jan, Yes. For example, I put a previous command at the prompt to be modified. It began with 'insert ...' so I added an initial \e to the command. psql told me that \einsert is not a valid command after I pressed the [Enter]

Re: External psql editor

2022-04-29 Thread Rich Shepard
On Fri, 29 Apr 2022, Reid Thompson wrote: https://linuxgazette.net/issue14/bashtip.html may of of use. Reid, I've had no issues using joe in any v.t. running an application (e.g., alpine) or by itself. Apparently, psql is different. Rich

Re: External psql editor

2022-04-29 Thread Jan Wieck
On 4/29/22 16:17, Rich Shepard wrote: On Fri, 29 Apr 2022, Jan Wieck wrote: Did you hit Enter after \e ? Jan, Yes. For example, I put a previous command at the prompt to be modified. It began with 'insert ...' so I added an initial \e to the command. psql told me that \einsert is not a

Re: Replication with Patroni not working after killing secondary and starting again

2022-04-29 Thread Peter J. Holzer
On 2022-04-28 11:09:12 +0200, Zb B wrote: > > When the secondary starts up it should continue replicating from where > > it stopped. However, it can only do this if the necessary information is > > still available. If WAL files have been deleted in the mean time. it > > can't replay them. There

Re: External psql editor

2022-04-29 Thread David G. Johnston
On Fri, Apr 29, 2022 at 1:17 PM Rich Shepard wrote: > On Fri, 29 Apr 2022, Jan Wieck wrote: > > > Did you hit Enter after \e ? > > Jan, > > Yes. For example, I put a previous command at the prompt to be modified. It > began with 'insert ...' so I added an initial \e to the command. psql told >

Re: About postgresql-db Directory

2022-04-29 Thread Ron
On 4/28/22 04:39, Junsong Yang wrote: Hi, A directory called postgresql-db appeared after the postgres instance was deleted. I noticed that the mounting point(/var/lib/pgdata)disappeared. But another directory called postgresql-db appeared at /var/lib/postgresql-db which preserved all the

Re: Mail list manager request

2022-04-29 Thread Rich Shepard
On Fri, 29 Apr 2022, Kris Deugau wrote: At a not-entirely-wild guess, based on replies to your recent couple of posts, the messages that went astray were the direct mail copies that never passed through the list in the first place. I use an almost identical recipe myself (and a matching one for

Re: External psql editor

2022-04-29 Thread Jan Wieck
On 4/29/22 14:10, Rich Shepard wrote: I tried, unsuccessily, to use \e. Entering it while a command is displayed does nothing. So I'm doing something wrong. Did you hit Enter after \e ? Regards, Jan

Re: External psql editor

2022-04-29 Thread Reid Thompson
On Fri, 2022-04-29 at 11:10 -0700, Rich Shepard wrote: > On Fri, 29 Apr 2022, Jan Wieck wrote: > > > Not that I know of. \e starts the external editor and you have to > > save and > > exit that editor to get back to psql in order to execute it. IMHO > > the > > whole construct has very limited

External psql editor

2022-04-29 Thread Rich Shepard
I do all my postgres work using the psql shell. Editing a command reguires moving character-by-character and I'd like to use my small text editor (joe) because it allows more control over line movement. A web search found a stackexchange thread that suggested adding to ~/.bash_profile the line:

Re: External psql editor

2022-04-29 Thread Jan Wieck
On 4/29/22 11:55, Rich Shepard wrote: I do all my postgres work using the psql shell. Editing a command reguires moving character-by-character and I'd like to use my small text editor (joe) because it allows more control over line movement. A web search found a stackexchange thread that

Re: External psql editor

2022-04-29 Thread Francisco Olarte
Hi Rich: On Fri, 29 Apr 2022 at 17:55, Rich Shepard wrote: > I do all my postgres work using the psql shell. Editing a command reguires > moving character-by-character and I'd like to use my small text editor (joe) > because it allows more control over line movement. I do a similar thing, but

Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac

2022-04-29 Thread Sam Kidman
Ok, so apparently it's something wrong with our environments? Is it possible something is failing silently? Any tips for how to troubleshoot? BTW I'm not doing anything special when compiling, just git checkout REL_13_6, ./configure, ./make (unless I am doing something wrong there?) Also the

Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac

2022-04-29 Thread Sam Kidman
Actually I made some progress with this. I found if I: cd src/backend make generated-headers cd ../.. make it works. So for some reason that submake-generated-headers target isn't getting called for us. On Wed, Apr 27, 2022 at 11:38 PM Tom Lane wrote: > Laurenz Albe writes: > > On Wed,

Re: errcodes.h and others not generated when compiling 13.6 on M1 Mac

2022-04-29 Thread Sam Kidman
>Are you using any nondefault make options? Are you invoking our Makefile from some make script of your own? This all came about because we use asdf as a version manager which compiles the versions of various programs you want to use. There's potentially a problem with the asdf plugin for