Re: DECLARE CURSOR code question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: DECLARE CURSOR code question
Date: 2008-01-12 02:02:02
Message-ID: 29656.1200103322@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Neil Conway <neilc(at)samurai(dot)com> writes:
> In CVS HEAD, why does exec_simple_query() pass an empty cursorOptions to
> pg_plan_queries() at postgres.c:903? If we're planning DECLARE CURSOR,
> ISTM we ought to be passing down the DECLARE CURSOR's cursorOptions.

This code doesn't know (or care) whether it's dealing with DECLARE
CURSOR. The planner picks up the information for itself --- look at
the first few lines of standard_planner().

The cursorOptions parameter to planner() is kinda vestigial now as far
as DECLARE CURSOR itself is concerned, but I left it in there since
the SPI_prepare_cursor() API exposes it, and it seemed potentially
useful for callers like plpgsql FOR-loops, which might want to impose
some chosen semantics without physically modifying a querytree.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-01-12 02:59:46 A note about SIGTERM illusion and reality
Previous Message August Zajonc 2008-01-12 01:53:37 Re: Dynamic Partitioning using Segment Visibility Maps