question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Default schema is not recognized on latest version

See original GitHub issue

Hello, 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:closed
  • Created a year ago
  • Reactions:1
  • Comments:21 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
kataggartcommented, Sep 21, 2022

@SambitNanda It is in our queue to resolve. Sorry we haven’t been able to get to it yet.

1reaction
SambitNandacommented, Oct 21, 2022

@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

Read more comments on GitHub >

github_iconTop Results From Across the Web

default schema not working? - MSDN - Microsoft
I connect to the database, and the default schema seems to be set to ... NOT that you cannot set it for a...
Read more >
Liquibase: setDefaultSchema is not working - Stack Overflow
I am looking for a better solution. Workaround: Before running migration, I save current tenant's schema in a jvm argumanet as below. System....
Read more >
How do I resolve issues with missing or incorrect schema ...
RuntimeError: Database version is not found in table LSW_SYSTEM_SCHEMA, the jndi for the database is 'jdbc/PerformanceDB'. The database version check SQL is ...
Read more >
SSM document schema features and examples
By using the latest schema version for Command and Policy documents, ... If you have multiple versions of a document, you can specify...
Read more >
sql server - Default schema is ignored on SELECT
The login user is not a member of the sysadmin group, but only of serveradmin and public . · The mapped database user...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found