7.4b4 domain usage and select question

Поиск
Список
Период
Сортировка
От Robert Creager
Тема 7.4b4 domain usage and select question
Дата
Msg-id 20031018104218.49191343.Robert_Creager@LogicalChaos.org
обсуждение исходный текст
Ответы Re: 7.4b4 domain usage and select question
Список 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

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Jason Sheets
Дата:
Сообщение: Re: Postgres seems to BE on windowsXP
Следующее
От: "Jitender Kumar C"
Дата:
Сообщение: Timestamp to date conversion...plz help me