* Add column and table comments in SQLT::Parser::DBI::PostgreSQL(patch from Andrew Pam)
* Fixed alter_drop_constraint for foreign keys and applying multiple changes
via alter_field to a column in Postgres Producer
-* added a working mechanism for naming foreign keys in the PostgreSQL producer
+* Added a working mechanism for naming foreign keys in the PostgreSQL producer
+* Fix PostgreSQL ignoring default values with specified data type
* Fix possible name duplication in SQLlite producer
* Oracle does not accept ON DELETE/UPDATE RESTRICT (though it is the actual default)
fix by not adding the ON DELETE/UPDATE clause at all
create_index : CREATE /index/i
-default_val : DEFAULT /(\d+|'[^']*'|\w+\(.*\))|\w+/
+default_val : DEFAULT /(\d+|'[^']*'|\w+\(.*\))|\w+/ ( '::' data_type )(?)
{
my $val = defined $item[2] ? $item[2] : '';
$val =~ s/^'|'$//g;
f_varchar character varying (255),
f_double double precision,
f_bigint bigint not null,
- f_char character(10) default 'FOO',
+ f_char character(10) default 'FOO'::character(10),
f_bool boolean,
f_bin bytea,
- f_tz timestamp,
+ f_tz timestamp default '1970-01-01 00:00:00'::TIMESTAMP,
f_text text,
f_fk1 integer not null references t_test2 (f_id),
f_dropped text,
is( $f8->data_type, 'timestamp', 'Field is a timestamp' );
is( $f8->is_nullable, 1, 'Field can be null' );
is( $f8->size, 0, 'Size is "0"' );
-is( $f8->default_value, undef, 'Default value is undefined' );
+is( $f8->default_value, '1970-01-01 00:00:00', 'Default value is 1970-01-01 00:00:00' );
is( $f8->is_primary_key, 0, 'Field is not PK' );
my $f9 = shift @t1_fields;