Re: Range Types - cache lookup failed for function

From: "Erik Rijkers" <er(at)xs4all(dot)nl>
To: "Jeff Davis" <pgsql(at)j-davis(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Range Types - cache lookup failed for function
Date: 2011-02-06 19:10:53
Message-ID: d11842549594d7aa797fa86dd82c937f.squirrel@webmail.xs4all.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, February 6, 2011 07:41, Jeff Davis wrote:
> New patch. All known TODO items are closed, although I should do a

I've been testing and find the patch to be
generally very stable.

More review follows ASAP, but I wanted to mention
this curious 'bug' already.

(below all with latest git + patch 2011.02.05; but
occurred also in 2011.01.30 version)

I was trying
where intrange @> integer

which admittedly is not in the documentation,
but does already half work, and would be really
convenient to have. As it stands the construct
seems to fail after ANALYZE, when there is more
than 1 row:

-- file t/cache_lookup_failure2.sql
drop table if exists t;
create table t (ir int4range);
insert into t values (range(1,11));
select count(*) from t;
select * from t where ir @> 5; --> OK
analyze t;
select * from t where ir @> 5; --> OK
insert into t values (range(1,11));
select * from t where ir @> 5;
analyze t;
select * from t where ir @> 5;
------------------------
running that file gives me

PGPORT=6563
PGDATA=/var/data1/pg_stuff/pg_installations/pgsql.range_types/data
PGDATABASE=testdb

2011.02.06 20:03:03 rijkers(at)denkraam:/var/data1/pg_stuff/pg_sql/pgsql.range_types [0]
$ clear; psql -Xqa -d testdb -f t/cache_lookup_failure2.sql
drop table if exists t;
create table t (ir int4range);
insert into t values (range(1,11));
select count(*) from t;
count
-------
1
(1 row)

select * from t where ir @> 5; --> OK
ir
-----------
[ 1, 11 )
(1 row)

analyze t;
select * from t where ir @> 5; --> OK
ir
-----------
[ 1, 11 )
(1 row)

insert into t values (range(1,11));
select * from t where ir @> 5;
ir
-----------
[ 1, 11 )
[ 1, 11 )
(2 rows)

analyze t;
select * from t where ir @> 5;
psql:t/cache_lookup_failure2.sql:11: ERROR: cache lookup failed for function 0

(of course I realize that
... WHERE ir @> range(5);

"fixes" the problem, but it would be
really nice to have it work on integers)

Thanks,

Erik Rijkers

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Urbański 2011-02-06 19:11:08 Re: pl/python quoting functions
Previous Message Stephen Frost 2011-02-06 19:10:27 Re: Add support for logging the current role