PostgreSQL schema paths

Folks-

  I’m trying to get started with LiquiBase 1.9.5 and calling generateChangeLog to get an initial file on an existing PostgreSQL (8.3/8.4) database. Problem I’m having is they have tables in different schema, other then public. Example table names are schemax.users, schemay.products. In the database in question, no tables are in the public instance.  Does LiquiBase work with multiple active schema paths? Can I configure it to at least manipulate a specific schema path?

  I was able to get liquibase working with a regular database who’s tables are in the public schema just fine. I tried setting the postgres.conf file so by default all schemas would be in the searchpath. Looking at the resulting SQL code generated by liquibase, the public schema is the only one being looked at.  Can anyone provide any pointers?

Thanks, Ned

Okay, didn’t see this documented in the command line, but saw it in the ant task… if you add --defaultSchemaName=schemax then it will pull what it can from that schema. I’ve got multiple schemas to do… so I’ll have to create one changeset per schema, which is fine in my case. But is there any way you can manipulate multiple schemas at once? Or will that have to be multiple changeset.xml files? (At least one per schema, and different calls per schema)

No support at this point, though it is being considered for liquibase 2.1

Nathan

If you do add support for it, it would be nice if, for example, liquibase could look for user-created schemas for the generateChangelog or dbDoc commands, or at least, optionally, have the schemas to check be listed as an argument. Setting the defaultSchemaName for each schema and running the commands isn’t good because it creates multiple databasechangelog tables, one per ‘default’ schema. For me, this is not a show-stopped. Its a ‘nice to have’.

BTW, I really like Liquibase so far. Just started using it coming from a rails env back to Java, and its quite nice to have.

Glad liquibase has been working out for you.  I’ll keep your thoughts in mind as we are working on 2.1.

Nathan

May I resurrect this thread please.


The app I’m using allows you to set the schema name on install and I have several instances installed in different places with different schema names.

When I run a diff I get:


Missing Catalog(s): 

     webscores

Unexpected Catalog(s): 

     socrates


and no differences. I know there are some diffs, but liquibase won’t find them.

Having different schema names might also be useful for migration or staging.

How can I specify that I want 2 different schema names compared against each other?


Hugh

I’m having problems too related to this topic.

Creation and updates works fine using any schema, but the rollback is failing as it tries to delete an object without specifying the schema:


The change set works properly

  1. ERROR: no existe el indice idx_table1


The sql command to rollback the index creation is not using the schema info.


Is this a bug from liquibase? what could i do to get the rollback working properly.


I’m using PostgreSQL 9.1 over windows 7 (x64). Java JDK 1.6.0_38,  Liquibase Version: 2.0.5  (tried version 3.0.2, but It has other issues regarding Postgresql syntax, even the schema creation failed)


Thanks in advance.




I confimed that the issue about rollback without schema is fixed in the Liquibase 3.0.2 version.


Thanks.