CREATE DATABASE cannot work inside a transaction block

I am working on an AWS + PostgreSQL server. When I execute a query to create a database, I get an error message:

CREATE DATABASE cannot run inside a transaction block 

I am working on Linux Ubuntu 12.04 LTS.

How can I solve this problem?

+5
source share
1 answer

I used the inclusion of autocommit in PostgreSQL and it works for me.

Here is a request to enable auto messaging

 SET AUTOCOMMIT = ON 
+9
source

Source: https://habr.com/ru/post/1205159/


All Articles