7.4b4 domain usage and select question - Mailing list pgsql-general

From Robert Creager
Subject 7.4b4 domain usage and select question
Date
Msg-id 20031018104218.49191343.Robert_Creager@LogicalChaos.org
Whole thread Raw
Responses Re: 7.4b4 domain usage and select question  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
I'm using 7.4b4 with domains, and am having a problem with selecting without
casting.

create domain test_domain as integer check( (value notnull) and (value >= 1) );
create table test_table( field_1 test_domain, field_2 integer );
insert into test_table values( 1, 1 );
insert into test_table values( '2', '2' );
select * from test_table where field_2 = '1';
select * from test_table where field_1 = '1'; -- fails

The last select fails with 'operator is not unique: test_domain = "unknown"'

The insert with quoted values works fine without casting.

The HINT indicates I need to cast, which works find with either '1'::integer or
'1'::test_domain.  Is this the correct behavior?  Do I have to cast every quoted
value?  The values are quoted through the usage of DBD::Pg.

Thanks,
Rob

--
 10:32:54 up 78 days,  2:58,  4 users,  load average: 2.00, 2.00, 2.00

Attachment

pgsql-general by date:

Previous
From: Jason Sheets
Date:
Subject: Re: Postgres seems to BE on windowsXP
Next
From: "Jitender Kumar C"
Date:
Subject: Timestamp to date conversion...plz help me