Wolfgang Keller wrote: > Hello, > > sorry it took me so long to reply. > >> As Ed suggested our current Postgres interface does not support >> special data types. But I would like it too. Could you describe >> the data type you are creating. Maybe there is a way. > > I am basically defining custom types for everything, so that I don't > have to use "native" datatypes in the table definitions: > > CREATE DOMAIN unsigned_smallint AS SMALLINT > CHECK(VALUE >= 0); > > CREATE DOMAIN unsigned_integer AS INTEGER > CHECK(VALUE >= 0); > > CREATE DOMAIN cris_range_0_100_type AS SMALLINT > CHECK(VALUE >= 0 AND VALUE <=100); > > CREATE DOMAIN cris_range_0_1_type AS DOUBLE > CHECK(VALUE >=0 AND VALUE <=1); > > CREATE DOMAIN cris_segment_or_asset_type AS CHARACTER(1) > CHECK(VALUE = 'A' OR VALUE = 'S'); > > CREATE DOMAIN cris_no_or_yes_type AS character(1) > CHECK(VALUE = 'N' OR VALUE = 'Y'); > > CREATE DOMAIN cris_motion_direction_type AS character(1) > CHECK(VALUE = 'N' OR VALUE = 'R'); > > CREATE DOMAIN cris_freq_or_order_type AS character(1) > CHECK(VALUE = 'F' OR VALUE = 'O'); > > CREATE DOMAIN cris_pct_or_oct_type AS character(1) > CHECK(VALUE = 'O' OR VALUE = 'P'); > > CREATE DOMAIN cris_secs_or_revs_type AS character(1) > CHECK(VALUE = 'R' OR VALUE = 'S'); > > CREATE TYPE cris_string16_type AS CHARACTER(16); > CREATE TYPE cris_string254_type AS CHARACTER VARYING(254); > CREATE TYPE cris_string4000_type AS CHARACTER VARYING(4000); > CREATE TYPE cris_base64binary_type AS BYTEA; > CREATE TYPE cris_ushort_type AS unsigned_smallint; > CREATE TYPE cris_short_type AS SMALLINT; > CREATE TYPE cris_uint_type AS unsigned_integer; > CREATE TYPE cris_double_type AS DOUBLE PRECISION; > > CREATE TYPE cris_datetime_type AS ( > datetime TIMESTAMP(0) WITHOUT TIME ZONE > nanoseconds NUMERIC(9, 9) > ); > > TIA, > > Sincerely, > > Wolfgang Keller
Do you get these domain names as datatypes from the fielddescription of the python DBAPI layer? If you really get these names you could extend Postgres.getFields() in dabo/db/dbPostgreSQL.py according to your private needs. Uwe _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/dabo-users/[EMAIL PROTECTED]
