I installed the package using: sudo apt install postgresql postgresql-contrib libpq-dev

but in postgresql mode: it was not creating database I am using ubuntu 22.04

I waited for an hour still it was running, I don't know why it was not creating database but it was executing alter statement

Could anyone help me to solve this problem?

this is the image

  • Is there anything interesting in the Postgres error log?
    – mustaccio
    Oct 3, 2022 at 14:28

1 Answer 1


Your statement is blocked by a lock. Most likely, somebody is connected to the template1 database. Terminate that database session, and the CREATE DATABASE statement should proceed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.