# liquibase.exception.DatabaseException: ERROR: syntax error at or near "\\"

**URL:** <https://forum.liquibase.org/t/liquibase-exception-databaseexception-error-syntax-error-at-or-near/9015>\
**Category:** General Discussion\
**Created:** [January 17, 2024, 8:10pm UTC](https://forum.liquibase.org/t/liquibase-exception-databaseexception-error-syntax-error-at-or-near/9015 "2024-01-17T20:10:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![srinivasu.49](https://avatars.discourse-cdn.com/v4/letter/s/258eb7/32.png) [@srinivasu.49](https://forum.liquibase.org/u/srinivasu.49)\
**Post date:** [January 17, 2024, 8:10pm UTC](https://forum.liquibase.org/t/liquibase-exception-databaseexception-error-syntax-error-at-or-near/9015/1 "2024-01-17T20:10:17Z")

</div>

Hi Team,

I am trying to run the Liquibase update with below change and getting the error message. Can someone please help me oh this issue.

Liquibase validate, update-sql commands are working fine, only liquibase update command is failing.

Note: I am using postgres database to do the same in local machine. Manual steps execution is working fine, but when I run the same change using Liquibase getting below error.

**dbchange.sql:**  
**============**  
–liquibase formatted sql  
–changeset srinivas:1.sql

\set tbl\_prefix

\set tbl\_passpoint\_user :tbl\_prefix’cloud\_passpoint\_user’  
\set tbl\_subscribers :tbl\_prefix’cloud\_subscribers’  
\set tbl\_myiq\_service :tbl\_prefix’cloud\_mycommunityiq\_service’

\echo :tbl\_passpoint\_user  
\echo :tbl\_subscribers  
\echo :tbl\_myiq\_service

## —Migration Steps—

## —Step1

## UPDATE :tbl\_passpoint\_user u SET name = s.name, first\_name = s.first\_name, last\_name = s.last\_name FROM :tbl\_subscribers s WHERE u.org\_id = s.org\_id AND u.subscriber\_id = s.subscriber\_id ;

## —Step2

## UPDATE :tbl\_passpoint\_user u SET uuid = uuid(s.subscriber\_id) FROM :tbl\_subscribers s WHERE u.org\_id = s.org\_id AND u.subscriber\_id = s.subscriber\_id AND s.subscriber\_location\_id LIKE ‘srinivas:%’ ;

* * *

## —Step3

UPDATE :tbl\_myiq\_service myiq  
SET user\_id = u.uuid  
FROM :tbl\_passpoint\_user u  
WHERE u.org\_id = myiq.org\_id AND u.subscriber\_id = myiq.subscriber\_id  
;

_ **Error Message:** _  
_ **================** _

Running Changeset: dbchange.sql::dbchange::srinivas

_Unexpected error running Liquibase: Migration failed for changeset dbchange.sql::dbchange::srinivas:_

- 

```
Reason: liquibase.exception.DatabaseException: ERROR: syntax error at or near "\"*

```

- Position: 1 [Failed SQL: (0) \set tbl\_prefix\*

\set tbl\_passpoint\_user :tbl\_prefix’cloud\_passpoint\_user’  
\set tbl\_subscribers :tbl\_prefix’cloud\_subscribers’  
\set tbl\_myiq\_service :tbl\_prefix’cloud\_mycommunityiq\_service’

\echo :tbl\_passpoint\_user  
\echo :tbl\_subscribers  
\echo :tbl\_myiq\_service

UPDATE :tbl\_passpoint\_user u  
SET name = s.name, first\_name = s.first\_name, last\_name = s.last\_name  
FROM :tbl\_subscribers s  
WHERE u.org\_id = s.org\_id AND u.subscriber\_id = s.subscriber\_id]

---

<div class="post-metadata">

**Author:** ![wwillard](https://avatars.discourse-cdn.com/v4/letter/w/8e8cbc/32.png) [@wwillard](https://forum.liquibase.org/u/wwillard)\
**Post date:** [January 18, 2024, 8:40pm UTC](https://forum.liquibase.org/t/liquibase-exception-databaseexception-error-syntax-error-at-or-near/9015/2 "2024-01-18T20:40:40Z")

</div>

Liquibase executes the SQL from the changelog through JDBC, so Postgres-specific directives like `\set` and `\echo` will most likely give you the syntax error you are seeing.

---

<div class="post-metadata">

**Author:** ![srinivasu.49](https://avatars.discourse-cdn.com/v4/letter/s/258eb7/32.png) [@srinivasu.49](https://forum.liquibase.org/u/srinivasu.49)\
**Post date:** [January 18, 2024, 9:17pm UTC](https://forum.liquibase.org/t/liquibase-exception-databaseexception-error-syntax-error-at-or-near/9015/3 "2024-01-18T21:17:31Z")

</div>

Hi @wwillard , Does liquibase handle these type errors? If yes may I know the work around to fix this issue please.

---

<div class="post-metadata">

**Author:** ![wwillard](https://avatars.discourse-cdn.com/v4/letter/w/8e8cbc/32.png) [@wwillard](https://forum.liquibase.org/u/wwillard)\
**Post date:** [January 18, 2024, 9:18pm UTC](https://forum.liquibase.org/t/liquibase-exception-databaseexception-error-syntax-error-at-or-near/9015/4 "2024-01-18T21:18:45Z")

</div>

Liquibase just catches and reports the SQL exception thrown by the driver.

---

<div class="post-metadata">

**Author:** ![srinivasu.49](https://avatars.discourse-cdn.com/v4/letter/s/258eb7/32.png) [@srinivasu.49](https://forum.liquibase.org/u/srinivasu.49)\
**Post date:** [January 22, 2024, 4:44am UTC](https://forum.liquibase.org/t/liquibase-exception-databaseexception-error-syntax-error-at-or-near/9015/5 "2024-01-22T04:44:23Z")

</div>

@wwillard Which means Liquibase doesn’t support the specifications like \set , \echo etc…

Please help us on this.

---

<div class="post-metadata">

**Author:** ![wwillard](https://avatars.discourse-cdn.com/v4/letter/w/8e8cbc/32.png) [@wwillard](https://forum.liquibase.org/u/wwillard)\
**Post date:** [January 22, 2024, 1:48pm UTC](https://forum.liquibase.org/t/liquibase-exception-databaseexception-error-syntax-error-at-or-near/9015/6 "2024-01-22T13:48:14Z")

</div>

Liquibase Community version does not support database-specific directives. Liquibase Pro does support these directives with its native executor feature, which runs the SQL through the database’s command line tool, i.e. `psql`, `sqlplus`, etc.
