Re: ERROR: cursor variable must be a simple variable (LINE XX: OPEN vQuery.cursorReturn FOR )

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: William(dot)Burke(at)collins(dot)com
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: ERROR: cursor variable must be a simple variable (LINE XX: OPEN vQuery.cursorReturn FOR )
Date: 2022-04-28 16:09:31
Message-ID: CAKFQuwav6X0op5notqDDFX0M1oTzR1m3YBCbJNBQC4f7HHLWdQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Apr 28, 2022 at 8:03 AM Burke, William J Collins <
William(dot)Burke(at)collins(dot)com> wrote:

> Hello,
>
>
>
> I encountered the following error when compiling a pgsql function after an
> upgrade from PostgresSQL 9.3 on RHEL7 to PostgreSQL 12.9 on RHEL8, and
> could use some help from the community to figure out why.
>
>
>
> ERROR: cursor variable must be a simple variable
>
> LINE XX: OPEN vQuery.cursorReturn FOR
>
> ^
>
> SQL state: 42804
>
>
>
> After looking through the CURSOR documentation for PG9.3 and PG12, I
> noticed that the following statement is identical for both versions of
> PostgreSQL:
>
>
>
Per testing on db-fiddle this started reporting an error in v11.

I took a peek but didn't see anything directly affecting this; but quite a
bit of technical debt repayment happened that cycle and since the current
behavior matches the documentation, and there were/are no test cases for
this situation, the behavior change isn't surprising.

I'd accept a bug and backpatch solution here, though, if someone wished to
write one. We currently support a version (10) that allows this code to
execute, seemingly without issue.

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2022-04-28 16:10:00 Re: parallel-processing multiple similar query tasks - any example?
Previous Message Shaozhong SHI 2022-04-28 15:54:30 Re: parallel-processing multiple similar query tasks - any example?