Unable to create column with type "TIMESTAMP WITHOUT TIME ZONE" in PostgreSQL

when I tried to create a column with the data type "TIMESTAMP WITHOUT TIME ZONE" in postgresql it is always created in the database as "TIMESTAMP WITH TIME ZONE", so are there any workarounds or solutions to this problem?

<addColumn tableName="myTable"> <column name="date_added" type="TIMESTAMP WITHOUT TIME ZONE"> <constraints nullable="false" /> </column> </addColumn> 

btw, this question is on jira: http://liquibase.jira.com/browse/CORE-877

+6
postgresql liquibase
source share
4 answers

Read this page http://www.liquibase.org/documentation/sql_format.html . just manually enter the required SQL exactly the way you want if you use the SQL format with Liquibase.

0
source share

Instead of using a tag and completely switching from XML to sql, you can modify the resulting generated SQL using a tag that is valid for the entire set of changes: http://www.liquibase.org/documentation/modify_sql.html

for example, in your case you will have the following:

 <modifySql dbms="postgresql"> <replace replace="WITH" with="WITHOUT"/> </modifySql> 
+12
source share

You can use <sql> to create the exact SQL you need if Liquibase creates the wrong SQL for you.

+1
source share

In addition to @magomarcelo, you can also write modifysql as YAML. The following example ignores unsigned in postgresql:

 - modifySql: dbms: postgresql replace: replace: unsigned with: default 0 
0
source share

All Articles