PostgreSQL Bugs

Collected from the PG bugs email list.

Bug ID16290
PG Version11.6
OSLinux
Opened2020-03-10 05:40:15+00
Reported byapoorv malik
StatusNew

Body of first available message related to this bug follows.

The following bug has been logged on the website:

Bug reference:      16290
Logged by:          apoorv malik
Email address:      (redacted)
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

Messages

DateAuthorSubject
2020-03-10 05:40:15+00PG Bug reporting formBUG #16290: Unable to run \set AUTOCOMMIT off
2020-03-10 06:26:57+00"David G(dot) Johnston"Re: BUG #16290: Unable to run \set AUTOCOMMIT off