On Sat, Aug 27, 2005 at 05:21:46PM +0400, Oleg Bartunov wrote:
> This query works as expected:
> # select  name_qualified from place
> where fts_index @@ to_tsquery('moscow');
> 
> This query (essentially the same as above) crashes:
> # select  name_qualified from place, to_tsquery('moscow') as query 
> where fts_index @@ query;
> 
> When I disable bitmap scanning (set enable_bitmapscan=off)
> second query works fine.

Disabling enable_bitmapscan causes my example to succeed, but when
I do get the error I don't get a crash, and the same query without
EXPLAIN succeeds:

CREATE TABLE foo (x integer);
CREATE INDEX foo_x_idx ON foo (x);
CREATE VIEW fooview AS SELECT count(*) FROM foo WHERE x < 10;

SET enable_bitmapscan TO on;

SELECT * FROM fooview;
 count 
-------
     0
(1 row)

EXPLAIN SELECT * FROM fooview;
ERROR:  bogus varno: 5

SET enable_bitmapscan TO off;

EXPLAIN SELECT * FROM fooview;
                                  QUERY PLAN                                  
------------------------------------------------------------------------------
 Aggregate  (cost=32.41..32.41 rows=1 width=0)
   ->  Index Scan using foo_x_idx on foo  (cost=0.00..30.63 rows=713 width=0)
         Index Cond: (x < 10)
(3 rows)

-- 
Michael Fuhr

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Reply via email to