# Liquibase maven plugin: cannot find the databasechangelog table, PostgreSQL

**URL:** <https://forum.liquibase.org/t/liquibase-maven-plugin-cannot-find-the-databasechangelog-table-postgresql/4415>\
**Category:** General Discussion\
**Created:** [July 17, 2020, 9:56am UTC](https://forum.liquibase.org/t/liquibase-maven-plugin-cannot-find-the-databasechangelog-table-postgresql/4415 "2020-07-17T09:56:32Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ned](https://avatars.discourse-cdn.com/v4/letter/n/848f3c/32.png) [@ned](https://forum.liquibase.org/u/ned)\
**Post date:** [July 17, 2020, 9:56am UTC](https://forum.liquibase.org/t/liquibase-maven-plugin-cannot-find-the-databasechangelog-table-postgresql/4415/1 "2020-07-17T09:56:32Z")

</div>

Hi there, I have a problem running maven plugin org.liquibase:liquibase-maven-plugin:3.9.0 with Spring. I have a changelog file include all files from folder. When i start liquibase with this changeset - all things go perfect.  
Liquibase Version: 3.10.1  
Running Java under C:\Program Files\Java\jdk-11.0.7 (Version 11.0.7)  
Driver: postgresql-42.2.11.jar

When i run the same changelog with maven with defined profiles in pom.xml with command  
mvn liquibase:update -Pdev  
i have an error:  
“Execution default-cli of goal org.liquibase:liquibase-maven-plugin:3.9.0:update failed: liquibase.exception.DatabaseException: Error executing SQL SELECT MAX(ORDEREXECUTED) FROM databasechangelog: ERROR: relation “databasechangelog” does not exist”

Could some give me a some idea what could be a problem?

---

<div class="post-metadata">

**Author:** ![ronak](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/ronak/32/221_2.png) [@ronak](https://forum.liquibase.org/u/ronak)\
**Post date:** [July 17, 2020, 7:25pm UTC](https://forum.liquibase.org/t/liquibase-maven-plugin-cannot-find-the-databasechangelog-table-postgresql/4415/2 "2020-07-17T19:25:28Z")

</div>

Hi @ned!

Welcome to the forum!

The error:

> [@ned](#):
>
> “Execution default-cli of goal org.liquibase:liquibase-maven-plugin:3.9.0:update failed: liquibase.exception.DatabaseException: Error executing SQL SELECT MAX(ORDEREXECUTED) FROM databasechangelog: ERROR: relation “databasechangelog” does not exist”

Indicates to me that liquibase is failing to find the [databasechangelog table](https://docs.liquibase.com/concepts/basic/databasechangelog-table.html), which access to read or create is required.

Is the maven run targetting the same database the Springboot run of liquibase was?  
Using the same user?

Thanks,

Ronak

---

<div class="post-metadata">

**Author:** ![ned](https://avatars.discourse-cdn.com/v4/letter/n/848f3c/32.png) [@ned](https://forum.liquibase.org/u/ned)\
**Post date:** [July 19, 2020, 9:21am UTC](https://forum.liquibase.org/t/liquibase-maven-plugin-cannot-find-the-databasechangelog-table-postgresql/4415/3 "2020-07-19T09:21:07Z")

</div>

Hi @ronak!  
Yes, the same database with the same user.

The first changeset is executed. After it’s execution I have the messages:  
SELECT MAX(ORDEREXECUTED) FROM databasechangelog  
[INFO] Successfully released change log lock  
[ERROR] Could not release lock  
liquibase.exception.LockException: liquibase.exception.DatabaseException: Error executing SQL UPDATE databasechangeloglock SET LOCKED = FALSE, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1: ERROR: relation “databasechangeloglock” does not exist

I’ve checked in the database. The table “databasechangeloglock” is created. I think It couldn’t continue because the state in databasechangeloglock table column “locked” is true. The table databasechangelog is empty. It is not indicated that the first changeset is executed.

Greetings!

---

<div class="post-metadata">

**Author:** ![ronak](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/ronak/32/221_2.png) [@ronak](https://forum.liquibase.org/u/ronak)\
**Post date:** [July 20, 2020, 6:07pm UTC](https://forum.liquibase.org/t/liquibase-maven-plugin-cannot-find-the-databasechangelog-table-postgresql/4415/4 "2020-07-20T18:07:11Z")

</div>

Hi @ned,

Hmm…it is true if there is a row in the databasechangeloglock table, then it indicates there is a lock. Perhaps the process got destroyed before liquibase could finish?

Have you tried deleting the row in databasechangeloglock table (leaving it empty) and running the liquibase update (via maven) again after that?

Thanks,

Ronak

---

<div class="post-metadata">

**Author:** ![smstromb](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@smstromb](https://forum.liquibase.org/u/smstromb)\
**Post date:** [July 21, 2020, 4:18pm UTC](https://forum.liquibase.org/t/liquibase-maven-plugin-cannot-find-the-databasechangelog-table-postgresql/4415/5 "2020-07-21T16:18:52Z")

</div>

@ronak

I’m experiencing the same behavior as @ned but on a completely fresh postgres db instance:

[INFO] ChangeSet liquibase/main.xml::1::smstromb ran successfully in 1828ms  
[INFO] SELECT MAX(ORDEREXECUTED) FROM databasechangelog  
[INFO] Successfully released change log lock  
[ERROR] Could not release lock  
liquibase.exception.LockException: liquibase.exception.DatabaseException: Error executing SQL UPDATE databasechangeloglock SET LOCKED = FALSE, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1: ERROR: relation “databasechangeloglock” does not exist

The databasechangeloglock and databasechangelog tables are created and the changset specified in the changelog is executed correctly, but it fails to find “databasechangeloglock” when attempting to remove the lock that it itself created. “databasechangelog” remains empty.

Running “UPDATE databasechangeloglock SET LOCKED = FALSE, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;” manually via psql does not return ERROR: relation “databasechangeloglock” does not exist.

Liquibase Version: 3.10.1  
JDK-8  
Driver: postgresql-42.2.14.jar

---

<div class="post-metadata">

**Author:** ![ned](https://avatars.discourse-cdn.com/v4/letter/n/848f3c/32.png) [@ned](https://forum.liquibase.org/u/ned)\
**Post date:** [July 22, 2020, 6:53am UTC](https://forum.liquibase.org/t/liquibase-maven-plugin-cannot-find-the-databasechangelog-table-postgresql/4415/6 "2020-07-22T06:53:22Z")

</div>

> [@ned](#):
>
> C:\Program Files\Java\

Yes, I’ve tried. I remove the first row and start again update. The same error.

---

<div class="post-metadata">

**Author:** ![ronak](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/ronak/32/221_2.png) [@ronak](https://forum.liquibase.org/u/ronak)\
**Post date:** [July 23, 2020, 9:04pm UTC](https://forum.liquibase.org/t/liquibase-maven-plugin-cannot-find-the-databasechangelog-table-postgresql/4415/7 "2020-07-23T21:04:41Z")

</div>

Let me see if I can reproduce this error. Here’s what I am going to do, let me know @ned (or @smstromb) if you don’t have the same setup:

- install Liquibase (my local system is a Mac, what are you using?)
- Create a liquibase project (folder with liquibase.properties, changelog.xml)
- make sure liquibase.properties is pointing to a postgres db (what version are you using?)
- run a liquibase update and see if I get the databasechangeloglock table error.

Thanks,

Ronak

---

<div class="post-metadata">

**Author:** ![ned](https://avatars.discourse-cdn.com/v4/letter/n/848f3c/32.png) [@ned](https://forum.liquibase.org/u/ned)\
**Post date:** [July 24, 2020, 6:53am UTC](https://forum.liquibase.org/t/liquibase-maven-plugin-cannot-find-the-databasechangelog-table-postgresql/4415/8 "2020-07-24T06:53:48Z")

</div>

Hi @ronak !  
My local system is Windows 10. Yes I created in src/main/resources folder liquibase. Add liquibase-dev.properties. Define profiles in pom.xml. liquibase.properties points to my local postgres database.  
Use connector.changelog.xml in which I included two changelog’s.

Postgres Version 12  
Liquibase Version: 3.10.1  
Driver: postgresql-42.2.11.jar

---

<div class="post-metadata">

**Author:** ![ned](https://avatars.discourse-cdn.com/v4/letter/n/848f3c/32.png) [@ned](https://forum.liquibase.org/u/ned)\
**Post date:** [August 13, 2020, 8:30am UTC](https://forum.liquibase.org/t/liquibase-maven-plugin-cannot-find-the-databasechangelog-table-postgresql/4415/9 "2020-08-13T08:30:09Z")

</div>

Hi @smstromb!

Did you find some solution for the problem with maven. I still have no solution.

Greetings 🙂
