Re: External psql editor

Поиск
Список
Период
Сортировка
Искать
От
Adrian Klaver
Тема
Re: External psql editor
Дата
Msg-id
a1b5885f-0634-6324-a318-eb35ed45ec2b@aklaver.com
Ответ на
Re: External psql editor (Mladen Gogala)
Список
Дерево обсуждения
External psql editor Rich Shepard <rshepard@appl-ecosys.com>
Re: External psql editor Jan Wieck <jan@wi3ck.info>
Re: External psql editor Rich Shepard <rshepard@appl-ecosys.com>
Re: External psql editor Jan Wieck <jan@wi3ck.info>
Re: External psql editor Mladen Gogala <gogala.mladen@gmail.com>
Re: External psql editor Jan Wieck <jan@wi3ck.info>
Re: External psql editor Adrian Klaver <adrian.klaver@aklaver.com>
Re: External psql editor Rich Shepard <rshepard@appl-ecosys.com>
Re: External psql editor Jan Wieck <jan@wi3ck.info>
Re: External psql editor Rich Shepard <rshepard@appl-ecosys.com>
Re: External psql editor Jan Wieck <jan@wi3ck.info>
Re: External psql editor Rich Shepard <rshepard@appl-ecosys.com>
Re: External psql editor Rich Shepard <rshepard@appl-ecosys.com>
Re: External psql editor "David G. Johnston" <david.g.johnston@gmail.com>
Re: External psql editor Rich Shepard <rshepard@appl-ecosys.com>
Re: External psql editor Reid Thompson <jreidthompson@nc.rr.com>
Re: External psql editor Rich Shepard <rshepard@appl-ecosys.com>
Re: External psql editor Reid Thompson <jreidthompson@nc.rr.com>
Re: External psql editor Rich Shepard <rshepard@appl-ecosys.com>
Re: External psql editor Tom Lane <tgl@sss.pgh.pa.us>
Re: External psql editor Steve Litt <slitt@troubleshooters.com>
Re: External psql editor "Peter J. Holzer" <hjp-pgsql@hjp.at>
Re: External psql editor Mladen Gogala <gogala.mladen@gmail.com>
Re: External psql editor Rich Shepard <rshepard@appl-ecosys.com>
Re: External psql editor Francisco Olarte <folarte@peoplecall.com>
Re: External psql editor Rich Shepard <rshepard@appl-ecosys.com>
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 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 file like that would simplify 
> the cleaning process. The name comes from another database with the same 
> editor construct as \e. I am actually quite used to that.

If want to do something like that you would need to do(using VIM here):

\e
select 1;
:w afiedt.buf

or
:wq afiedt.buf

Assuming you closed the editor you could pick up the file later by doing.

\e afiedt.buf

> 
> Regards
> 
> -- 
> Mladen Gogala
> Database Consultant
> Tel: (347) 321-1217
> https://dbwhisperer.wordpress.com
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com


В списке pgsql-general по дате отправления
От: Rich Shepard
Дата:
Сообщение: Re: External psql editor
От: Avi Weinberg
Дата:
FAQ