IT quiz
All questions
Sign in
Sign up
JavaScript
HTML
CSS
PostgreSQL
PHP
Linux
Git
Docker
SCSS
TypeScript
SQL
Vue
DNS
Go
frontend (web)
Redis
backend
Gitlab
CI/CD
Vite
webpack
Node.js
HTTP
Python
Kotlin
Nuxt
Question #84
Author:
admin
tags:
PostgreSQL
DROP DATABASE somedb WITH (FORCE);
What does the
WITH (FORCE)
option do in this query?
Allows to remove a database, even if it has any tables
Allows to remove a database, if it has tables, but they are all empty
Allows to remove a database, even it has existing connections, by terminating them
Allows to remove a database, even if the user does not have the appropriate permissions
Answer
Show explanation
FORCE
option - attempt to terminate all existing connections to the target database.
It doesn't terminate if prepared transactions, active logical replication slots or subscriptions are present in the target database.
This will fail if the current user has no permissions to terminate other connections.
The option is available starting from PostgreSQL 13.
Rate the difficulty of the question:
1
2
3
4
5
6
7
8
9
10
easy
hard
←
Previous question (PostgreSQL)
Next question (PostgreSQL)
→
Write new comment