I'm trying to drop a database with force, but I get the following ERROR: syntax error at or near "WITH"
postgres=# DROP DATABASE IF EXISTS my_database WITH (FORCE);
ERROR: syntax error at or near "WITH"
LINE 1: DROP DATABASE IF EXISTS my_database WITH (FORCE);
I'm using Postgres 10.
What could cause this error?
UPDATE
Migrating the db to a new v16 cluster and changing it's port to the default 5432 did the trick.
I had a similar issue (syntax error at or near "force").
I then realized that the parenthesis around force are mandatory.
query that worked for me.
DROP DATABASE <DB_NAME> WITH (FORCE);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With