# diffChangelog working only on public schema

**URL:** <https://forum.liquibase.org/t/diffchangelog-working-only-on-public-schema/5608>\
**Category:** Community Answers\
**Created:** [June 16, 2021, 2:59pm UTC](https://forum.liquibase.org/t/diffchangelog-working-only-on-public-schema/5608 "2021-06-16T14:59:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ross](https://avatars.discourse-cdn.com/v4/letter/r/e274bd/32.png) [@Ross](https://forum.liquibase.org/u/Ross)\
**Post date:** [June 16, 2021, 2:59pm UTC](https://forum.liquibase.org/t/diffchangelog-working-only-on-public-schema/5608/1 "2021-06-16T14:59:32Z")

</div>

I have two different redshift databases which have **multiple schemas** in them . When I use **diffChangelog** with appropriate parameters , liquibase generates a dbchangelog.sql file which consist of changesets. But those changesets are only with respect to **public** schema and doesn’t include other schemas. How to use diffChangelog to get changesets for all schemas ?

---

<div class="post-metadata">

**Author:** ![rakhi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/rakhi/32/288_2.png) [@rakhi](https://forum.liquibase.org/u/rakhi)\
**Post date:** [June 18, 2021, 5:40am UTC](https://forum.liquibase.org/t/diffchangelog-working-only-on-public-schema/5608/2 "2021-06-18T05:40:36Z")

</div>

Hi @Ross

Could you please share the exact command you have tried to generate changelog file?

This will help to provide details about what went wrong.

Also please provide the Liquibase version you are currently using.

Thanks,  
Rakhi Agrawal

---

<div class="post-metadata">

**Author:** ![Ross](https://avatars.discourse-cdn.com/v4/letter/r/e274bd/32.png) [@Ross](https://forum.liquibase.org/u/Ross)\
**Post date:** [June 18, 2021, 6:48am UTC](https://forum.liquibase.org/t/diffchangelog-working-only-on-public-schema/5608/3 "2021-06-18T06:48:20Z")

</div>

**Liquibase version :** 4.3.5  
**Command used :**  
liquibase  
–changeLogFile=dbchangelog.xml  
–outputFile=mydiff.txt  
–url=  
–username=  
–password=  
diffChangeLog  
–referenceUrl=  
–referenceUsername=  
–referencePassword=

Both databases are redshift

---

<div class="post-metadata">

**Author:** ![rakhi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/rakhi/32/288_2.png) [@rakhi](https://forum.liquibase.org/u/rakhi)\
**Post date:** [June 18, 2021, 9:22am UTC](https://forum.liquibase.org/t/diffchangelog-working-only-on-public-schema/5608/4 "2021-06-18T09:22:58Z")

</div>

Hey @Ross

There are below ways you can achieve your goal:

1. Using DB snapshot as provided on [this link](https://docs.liquibase.com/workflows/liquibase-community/diffing-multiple-schemas-in-liquibase.html).

> Run the `diffChangeLog` command specifying the snapshot (an offline mode) and the database with new changes:
> 
> ```auto
> liquibase
> --referenceUrl=jdbc:postgresql://localhost:5432/MYDATABASE
> --url=offline:postgresql?snapshot=mySnapshot.json
> --changeLogFile=mydiffchangelog.xml
> diffChangeLog
> 
> ```
> 
> The generated changelog will contain new changes. Now, you can compare and confirm those changes.

1. The other way is you can use below command:

```auto
liquibase
--changeLogFile=dbchangelog.xml
--outputFile=mydiff.txt
--url=
--username=
--password=
--defaultSchemaName=
diffChangeLog
--referenceUrl=
--referenceUsername=
--referencePassword=
--referenceDefaultSchemaName=

```

Just provide one schema name at a time to generate diff results. (Should work with more than one schema names as well, haven’t tried)

1. You can also try this command:

```auto
liquibase
--changeLogFile=dbchangelog.xml
--outputFile=mydiff.txt
--url=
--username=
--password=
--schemas= <all comma separated schema names goes here>
diffChangeLog
--referenceUrl=
--referenceUsername=
--referencePassword=

```

This should also work.

Please give these a try and let us know the results.

Thanks!  
Rakhi Agrawal

---

<div class="post-metadata">

**Author:** ![Ross](https://avatars.discourse-cdn.com/v4/letter/r/e274bd/32.png) [@Ross](https://forum.liquibase.org/u/Ross)\
**Post date:** [June 18, 2021, 2:01pm UTC](https://forum.liquibase.org/t/diffchangelog-working-only-on-public-schema/5608/5 "2021-06-18T14:01:34Z")

</div>

Thank you very much @rakhi
