Create Database error - cannot run inside a transaction block
Posted: 16.10.2023, 13:50
Hi everyone!
Can anyone help with this question?
Zeos version: 7.2.14-release
Delphi Version: 10 - Seattle
Postgresql Version: 9.3
I'm trying create database with Zeos on runtime with ZSQLProcessor, but i receive this error:
CREATE DATABASE cannot run inside a transaction block
My script create database:
Observation: In another topic, an user say to change the property "TransactIsolationLevel" to "tiNone", but doesn't work for me.
(because see in the image that I'm already passing it as itNone)
Thank you so much! Hugs
Can anyone help with this question?
Zeos version: 7.2.14-release
Delphi Version: 10 - Seattle
Postgresql Version: 9.3
I'm trying create database with Zeos on runtime with ZSQLProcessor, but i receive this error:
CREATE DATABASE cannot run inside a transaction block
My script create database:
Code: Select all
ZSQLProcessor := TZSQLProcessor.Create(Self);
ZSQLProcessor.Connection := ConexaoLog;
script := 'CREATE DATABASE imagem '+
'WITH OWNER = postgres '+
'TABLESPACE = pg_default '+
'LC_COLLATE = ''Portuguese_Brazil.1252'' '+
'LC_CTYPE = ''Portuguese_Brazil.1252'' '+
'CONNECTION LIMIT = -1;';
ZSQLProcessor.Script.Text := script;
ZSQLProcessor.Execute;
ZSQLProcessor.free;
(because see in the image that I'm already passing it as itNone)
Thank you so much! Hugs