Skip to content

CURSOR (WITH HOLD) support? #40

@df7cb

Description

@df7cb

https://postgr.es/m/CAPV2KRjd=ErgVGbvO2Ty20tKTEZZr6cYsYLxgN_W3eAo9pf5sw@mail.gmail.com revealed a bug in a WITH HOLD cursor:

BEGIN;
DECLARE "test-cursor-crash" CURSOR WITH HOLD FOR
            SELECT di.itemId FROM "debug".downloaded_images di
            LEFT JOIN (SELECT itemId, MIN(last_update) as last_update FROM "debug"."foo" GROUP BY itemId) computed ON di.itemId=computed.itemId
            WHERE COALESCE(last_update, '1970-01-01') < download_time;
FETCH 10000 IN "test-cursor-crash";
COMMIT;

I realize this requires sending a whole transaction instead of an isolated query, but I think it's worthwhile to explore some of the less-frequently used SQL features as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions