How to use postgresql 'domain' ?

9 views
Skip to first unread message

Konstantin Tokar

unread,
Apr 20, 2015, 8:51:14 AM4/20/15
to rose-db...@googlegroups.com

Hi!

If I use the
domains in data types, the data type is defined incorrectly:


CREATE DOMAIN cdate  AS timestamp with time zone  DEFAULT now();

CREATE TABLE test_table
(
  id bigserial NOT NULL
,
  cdate cdate NOT NULL
,
  CONSTRAINT pk_ra_type PRIMARY KEY
(id)
);



Loader creates:

__PACKAGE__->meta->setup(
    table  
=> 'test_table',

    columns
=> [
        id          
=> { type => 'bigserial', not_null => 1 },
        cdate      
=> { type => 'scalar', length => 8, not_null => 1 },
   
],

    primary_key_columns
=> [ 'id' ],

    allow_inline_column_values
=> 1,

);

How to edit types during generation? Maybe at some stage of generation can substitute the correct values? post_init_hook - the only opportunity to correct types?


Konstantin Tokar


Reply all
Reply to author
Forward
0 new messages