7.4b4 domain usage and select question

Started by Robert Creagerover 22 years ago6 messagesgeneral
Jump to latest
#1Robert Creager
Robert_Creager@LogicalChaos.org

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

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Robert Creager (#1)
Re: 7.4b4 domain usage and select question

Robert Creager <Robert_Creager@LogicalChaos.org> writes:

select * from test_table where field_1 = '1'; -- fails
The last select fails with 'operator is not unique: test_domain = "unknown"'

Works as expected in CVS tip ...

regards, tom lane

#3Robert Creager
Robert_Creager@LogicalChaos.org
In reply to: Tom Lane (#2)
Re: 7.4b4 domain usage and select question

When grilled further on (Sat, 18 Oct 2003 13:12:41 -0400),
Tom Lane <tgl@sss.pgh.pa.us> confessed:

Robert Creager <Robert_Creager@LogicalChaos.org> writes:

select * from test_table where field_1 = '1'; -- fails
The last select fails with 'operator is not unique: test_domain = "unknown"'

Works as expected in CVS tip ...

regards, tom lane

Per your suggestion, I grabbed the nightly snapshot. It works fine for the
domain problem I was encountering.

But, I cannot turn of logging of the duration! It's set to
log_min_duration_statement = 0, but still logs the duration of every statement.
This didn't happen with 7.4b4... I've set it high to not log most statements.

Cheers,
Rob

--
13:36:33 up 78 days, 6:02, 4 users, load average: 2.00, 2.00, 2.00

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Robert Creager (#3)
Re: 7.4b4 domain usage and select question

Robert Creager <Robert_Creager@LogicalChaos.org> writes:

But, I cannot turn of logging of the duration! It's set to
log_min_duration_statement = 0,

-1 turns it off now.

regards, tom lane

#5Robert Creager
Robert_Creager@LogicalChaos.org
In reply to: Tom Lane (#4)
Re: 7.4b4 domain usage and select question

When grilled further on (Sat, 18 Oct 2003 15:46:55 -0400),
Tom Lane <tgl@sss.pgh.pa.us> confessed:

Robert Creager <Robert_Creager@LogicalChaos.org> writes:

But, I cannot turn of logging of the duration! It's set to
log_min_duration_statement = 0,

-1 turns it off now.

Thanks. Didn't even thing of doing another initdb to see if the setting may of
changed...

Cheers,
Rob

--
13:54:49 up 78 days, 6:20, 4 users, load average: 2.00, 2.00, 2.00

#6Alvaro Herrera
alvherre@dcc.uchile.cl
In reply to: Robert Creager (#3)
Re: 7.4b4 domain usage and select question

On Sat, Oct 18, 2003 at 01:40:04PM -0600, Robert Creager wrote:

But, I cannot turn of logging of the duration! It's set to
log_min_duration_statement = 0, but still logs the duration of every
statement. This didn't happen with 7.4b4... I've set it high to not
log most statements.

The value has a different meaning now. You have to set it to -1 to
disable logging IIRC.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"In a specialized industrial society, it would be a disaster
to have kids running around loose." (Paul Graham)