Liquibase/PostgreSQL: how to preserve table case correctly?

こ雲淡風輕ζ 提交于 2019-11-28 05:01:52

问题


I'm using Liquibase 3.1.1 to create tables in PostgreSQL 9.1. For example:

<changeSet id="1" author="bob">
    <createTable tableName="BATCHES">
        <!-- .. -- >
    </createTable>
</changeSet>

However, the table gets created with a lowercase name:

# select * from "BATCHES";
ERROR:  relation "BATCHES" does not exist

Is there any way to have Liquibase generate DDL that preserves the case of the table (and column etc) names that I specify in the change log?


回答1:


You can use the objectQuotingStrategy="QUOTE_ALL_OBJECTS" attribute on your changeSet attribute or on the databaseChangeLog root element to override the default logic of "only quote objects that have to be"



来源:https://stackoverflow.com/questions/22616545/liquibase-postgresql-how-to-preserve-table-case-correctly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!