Обсуждение: left join in cursor

Поиск
Список
Период
Сортировка

left join in cursor

От
Alexey Dashevsky
Дата:
Hi.

Exists too tables (PostgreSQL 7.2.3):

a ("cl" integer primary key, a1, a2, ...) - 100000 records;

b ("cl" integer primary key, b1, b2, ...) - 800 records.

BEGIN;

DECLARE "c" SCROLL CURSOR FOR select a.*,r.b1 as rb1 from a left join b using 
(cl) order by a.cl;

FETCH FORWARD 100 in "c"; 

FETCH FORWARD 100 in "c";

MOVE -200 in "c";

NOTICE:  Message from PostgreSQL backend:The Postmaster has informed me that some other backenddied abnormally and
possiblycorrupted shared memory.I have rolled back the current transaction and amgoing to terminate your database
systemconnection and exit.Please reconnect to the database system and repeat your query.
 

Without left join - all rights.

Why?

Thanks in advance.


Re: left join in cursor

От
Tom Lane
Дата:
Alexey Dashevsky <alex@kpgaz.chernigov.ua> writes:
> DECLARE "c" SCROLL CURSOR FOR select a.*,r.b1 as rb1 from a left join b using
> (cl) order by a.cl;
> FETCH FORWARD 100 in "c"; 
> FETCH FORWARD 100 in "c";
> MOVE -200 in "c";
> [ core dump ]

Some plan node types don't cope very well with being run backwards.

There is a workaround for this in CVS tip, but not in 7.2.* nor (IIRC)
in 7.3.*.
        regards, tom lane