Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] How do I turn transactions off when using a tPostgresqlRow?

am trying to design a drop-create database job for postgres engine but it spit my face with the message "DROP DATABASE cannot run inside a transaction block".I use a workaround placing an END; and BEGIN statements before and after the drop and create statements like this
"END;
CREATE DATABASE aNewDb
WITH OWNER = postgres
ENCODING = 'UTF8'
TABLESPACE = pg_default;
BEGIN;"
But beside being ugly, the BEGIN start a new transaction at the end of my statement and it is going to be successful making my component return ok even when the statement fails and the runIf trigger connector doesn´t works correctly
HOW I DEACTIVATE TRANSACTIONS FOR THE tPostgresqlRow COMPONENT? THERE MOST BE A CHECKBOX OR SOMETHING FOR THIS MATTER!
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Well I fix the problem just adding the END sentence at the begining but ignoring the BEGIN sentence at the end of the query. It works perfectly
i.e.
END;
CREATE DATABASE aNewDb
WITH OWNER = postgres
ENCODING = 'UTF8'
TABLESPACE = pg_default;

View solution in original post

1 Reply
Anonymous
Not applicable
Author

Well I fix the problem just adding the END sentence at the begining but ignoring the BEGIN sentence at the end of the query. It works perfectly
i.e.
END;
CREATE DATABASE aNewDb
WITH OWNER = postgres
ENCODING = 'UTF8'
TABLESPACE = pg_default;