pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: apoorvmalik.appy@gmail.com
Subject: BUG #16290: Unable to run \set AUTOCOMMIT off
Date: Tue, 10 Mar 2020 05:40:15 +0000
Message-ID: <16290-6905a3cd1575acc1@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      16290
Logged by:          apoorv malik
Email address:      apoorvmalik.appy@gmail.com
PostgreSQL version: 11.6
Operating system:   Linux
Description:        

Hi,
I'm using Liquibase and trying to run multiple sql files. In the first sql
file, I want to define '\set AUTOCOMMIT off' so that I can rollback. 
This will be used for testing. Unfortunately, I can't use BEGIN; as there
are multiple files and can't be combined to one else Liquibase will not have
separate entries.

Could you please give me equivalent command for \set AUTOCOMMIT off -->  I
have tried all types of escaping but nothing seems to work.

set AUTOCOMMIT = off -->this works fine in Liquibase but fails at DB 

Here's the error:

Reason: liquibase.exception.DatabaseException: ERROR: syntax error at or
near "\"
  Position: 1 [Failed SQL: (0) \set AUTOCOMMIT off]
	at liquibase.changelog.ChangeSet.execute(ChangeSet.java:646)
	at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:53)
	at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:83)
	at liquibase.Liquibase.update(Liquibase.java:202)
	at liquibase.Liquibase.update(Liquibase.java:179)
	at liquibase.integration.commandline.Main.doMigration(Main.java:1399)
	at liquibase.integration.commandline.Main.run(Main.java:229)
	at liquibase.integration.commandline.Main.main(Main.java:143)
Caused by: liquibase.exception.DatabaseException: ERROR: syntax error at or
near "\"
  Position: 1 [Failed SQL: (0) \set AUTOCOMMIT off]
	at
liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:402)
	at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:59)
	at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:131)
	at
liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1274)
	at
liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1256)
	at liquibase.changelog.ChangeSet.execute(ChangeSet.java:609)
	... 7 common frames omitted
Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near
"\"
  Position: 1
	at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440)
	at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183)
	at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308)
	at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
	at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:307)
	at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:293)
	at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:270)
	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:266)
	at
liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:398)
	... 12 common frames omitted



view thread (2+ messages)  latest in thread

Message-ID: <16290-6905a3cd1575acc1@postgresql.org>
Permalink:  ../16290-6905a3cd1575acc1@postgresql.org/
Also on:    postgresql.org/message-id/16290-6905a3cd1575acc1@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, apoorvmalik.appy@gmail.com
  Subject: Re: BUG #16290: Unable to run \set AUTOCOMMIT off
  In-Reply-To: <16290-6905a3cd1575acc1@postgresql.org>
  References: <16290-6905a3cd1575acc1@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox