On Fri, Apr 01, 2005 at 02:46:10PM -0500, Tom Lane wrote:
>
> Mumble ... that patch I put in last week doesn't work at all, does it?
> Back to the drawing board.
I don't get the crash any more with the change you applied a little
while ago. Here's a test case that was crashing:
CREATE TABLE foo (
id serial PRIMARY KEY,
first_date date NOT NULL,
last_date date NOT NULL
);
CREATE INDEX foo_dates_idx ON foo (first_date, last_date);
INSERT INTO foo (first_date, last_date) VALUES ('2005-04-01', '2005-04-02');
INSERT INTO foo (first_date, last_date) VALUES ('2005-04-02', '2005-04-03');
INSERT INTO foo (first_date, last_date) VALUES ('2005-04-03', '2005-04-04');
INSERT INTO foo (first_date, last_date) VALUES ('2005-04-04', '2005-04-05');
ANALYZE foo;
SELECT * FROM foo WHERE first_date <= now() AND last_date >= now();
id | first_date | last_date
----+------------+------------
1 | 2005-04-01 | 2005-04-02
(1 row)
And now back to the "date - range" thread in pgsql-performance,
which is why I was looking at this in the first place....
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/