Is there an option that can change the "exit external editor -> query runs automatically" behaviour of the psql \e switch ? (Other than intentionally mangling the query syntax).
PostgreSQL – How to Prevent Query Execution After Exiting \e Editor in psql
postgresqlpsql
Related Question
- PostgreSQL Comments – SQL Comments Disappear with psql and \e
- Postgresql – Running queries one after the other in psql/scripting environment
- PostgreSQL – How to Control psql Displaying Rows with (END)
- PostgreSQL – Debugging Incomplete Backup in PSQL
- PostgreSQL – Prevent Different Connections from Treating bytea Differently
- PostgreSQL – Preventing Implicit Casting from bytea to text
- How to Make psql Restore Ignore Owner Information in PostgreSQL
Best Answer
Don't add a semicolon (
;
) and you are fine. I quote the manual about the\e
or\edit
meta-command here:To be clear: only the last statement that is not terminated with a semicolon is not executed. To execute nothing at all, make sure there are no complete statements before the last statement. I.e. no semicolons at all.