简体   繁体   中英

Change default separator in PostgreSQL

Is it possible to change the SQL command separator in PostgreSQL? The default one is a semicolon (;), but I would like to set it to something else. For example MySQL can do it using DELIMITER // .

There is no way to do that.

Not that you don't need to terminate a statement in SQL. The only time when you need a semicolon is when you want to send multiple commands to the server with a single call, like in

SELECT 42; DROP TABLE students

You need semicolons to terminate a statement in the command-line client psql . If you want to avoid a semicolon in psql , use \g as a replacement.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM