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]