I want to change the external editor in psql
. But the command select-editor
does not work. How can I change it? How do I run the command?
Postgresql – How to change the default external text editor in psql
configurationpostgresqlpsql
Related Question
- PostgreSQL – How to Conditionally Stop a psql Script Based on Variable Value
- PostgreSQL – How to Prevent Query Execution After Exiting \e Editor in psql
- PostgreSQL Performance – How to Time SQL Queries Using psql
- PostgreSQL Comments – SQL Comments Disappear with psql and \e
- PostgreSQL – How to Set a search_path Default on psql Command Execution
- Postgresql – In PostgreSQL URL I can’t use a password containing special characters
Best Answer
There are environmental variables you can set, from
man psql
The
PSQL_EDITOR
is if you want to specify a unique editor for just PostgreSQL. You can probably ignore that as not many people have a different editor for that, but in the event you're using a SQL Editor, go for it.On Linux, you probably want to change
EDITOR
. On Ubuntu and Debian, that's done like this,