How can I quote a named argument passed in to psql?
问题 psql has a construct for passing named arguments: psql -v name='value' which can then be referenced inside a script: SELECT :name; which will give the result ?column? ---------- value (1 row) During development, I need to drop and recreate copies of the database fairly frequently, so I'm trying to automate the process. So I need to run a query that forcibly disconnects all users and then drops the database. But the database this operates on will vary, so the database name needs to be an