Default schema is not recognized on latest version
See original GitHub issueHello, I have this changeset:
--changeset nicola:003 runAlways:true
--comment: call function which enable auditing for every table
SELECT audit_trigger_install();
--rollback -- nothing to do here
This functions exists inside the schema application
CREATE OR REPLACE FUNCTION application.audit_trigger_install()
...
Since about 2 years ago I started this project, I always used the changelog as you can see, without a specific declaration of which schema is the function installed. The command I used has always been:
liquibase \
--driver=org.postgresql.Driver \
--classpath=postgresql-42.2.20.jar \
--url=jdbc:postgresql://127.0.0.1/postgres \
--username=xxxxxx \
--password=yyyyyyyy \
--changeLogFile=databaseChangelog.xml \
--liquibaseSchemaName=liquibase \
--defaultSchemaName=application \
--contexts=dev\
update
You can see that there is a specific notation “defaultSchemaName” to allow Liquibase work on a specific schema, and that has always worked since always using the version 4.2.2 I installed at first
Liquibase Community 4.2.2 by Datical
####################################################
## _ _ _ _ ##
## | | (_) (_) | ##
## | | _ __ _ _ _ _| |__ __ _ ___ ___ ##
## | | | |/ _` | | | | | '_ \ / _` / __|/ _ \ ##
## | |___| | (_| | |_| | | |_) | (_| \__ \ __/ ##
## \_____/_|\__, |\__,_|_|_.__/ \__,_|___/\___| ##
## | | ##
## |_| ##
## ##
## Get documentation at docs.liquibase.com ##
## Get certified courses at learn.liquibase.com ##
## Free schema change activity reports at ##
## https://hub.liquibase.com ##
## ##
####################################################
Starting Liquibase at 17:54:49 (version 4.2.2 #36 built at 2020-12-09 20:07+0000)
Liquibase: Update has been successful.
Today I updated the version of Liquibase up to the latest one, 4.9.0 (no other changes, same changelog, same postgres driver, same liquibase command, …) and here is the result
####################################################
## _ _ _ _ ##
## | | (_) (_) | ##
## | | _ __ _ _ _ _| |__ __ _ ___ ___ ##
## | | | |/ _` | | | | | '_ \ / _` / __|/ _ \ ##
## | |___| | (_| | |_| | | |_) | (_| \__ \ __/ ##
## \_____/_|\__, |\__,_|_|_.__/ \__,_|___/\___| ##
## | | ##
## |_| ##
## ##
## Get documentation at docs.liquibase.com ##
## Get certified courses at learn.liquibase.com ##
## Free schema change activity reports at ##
## https://hub.liquibase.com ##
## ##
####################################################
Starting Liquibase at 18:06:46 (version 4.9.0 #1885 built at 2022-03-16 16:58+0000)
Liquibase Version: 4.9.0
Liquibase Community 4.9.0 by Liquibase
Running Changeset: databaseChangeLog_BUILD/changelog_1000_001_setup auto_trigger[audit_tables].sql::1000_001-003::nicola
Unexpected error running Liquibase: ERROR: function audit_trigger_install() does not exist
Hint: No function matches the given name and argument types. You might need to add explicit type casts.
Position: 8 [Failed SQL: (0) SELECT audit_trigger_install()]
The only way I found to be working (with this new release) is forcing the schema as prefix of the function inside the changelog;
SELECT application.audit_trigger_install();
But, while this seems to be working, has a wide impact on my changelogs because I have many cases like this. I then reverted the version back to previous 4.2.2 and it is working again.
What is going on? Something changed during one of the last releases? Thanks
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:21 (10 by maintainers)
Top GitHub Comments
@SambitNanda It is in our queue to resolve. Sorry we haven’t been able to get to it yet.
@filipelautert That is interesting. It wasn’t obvious in the documentation to me, but I will let you know the result if my testing. Thanks