Incorrect SQL generated for default column value in PostgreSQL for text columns

Description

Creating a table with a TEXT column that has a default value, it fails to put the single quotes around the default value.

The attached example.xml shows four cases:

example_good - Using defaultValue="''" as a work-around.

example_bad - Uses defaultValue="" (empty string) which generates the SQL "bad_column TEXT DEFAULT NOT NULL"

example_noquotes - Uses defaultValue="some_value" which generates the SQL "noquotes_column TEXT DEFAULT some_value NOT NULL", notice no single quotes around "some_value".

example_varchar - Comparison creating a VARCHAR column instead of a TEXT column, which generates "okay_column VARCHAR(250) DEFAULT '' NOT NULL" as expected.

The attached out.sql has the full output of an updateSQL run.

Environment

Linux, with Posgresql 9.2.4

Reporter

catflap

Components

Fix versions

Affects versions

Priority

Major
Configure