Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating Postgres Varchar Array Columns with Liquibase

Since using Arrays in columns is still more of a NoSQL than RDBMS way of storing a list, I understand that Liquibase doesn't officially support the type. However, when I use the PSQL statements from the docs, I get the following:

<column name="widgets" type="varchar(8)[]" />

Trace output:

liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: ERROR: syntax error at or near "("
...
Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near "("

The vary same DDL works as expected when run from the PSQL command line.

like image 461
Joseph Lust Avatar asked Dec 11 '22 15:12

Joseph Lust


1 Answers

It must be a bug of sorts in the PSQL parser. Just adding a space fixes it.

<column name="widgets" type="varchar(8) []" />

Liquibase must be changing the SQL string in some mior way.

like image 197
Joseph Lust Avatar answered Jan 12 '23 00:01

Joseph Lust