pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: domenico.l76@gmail.com
To: pgsql-docs@lists.postgresql.org
Subject: Re: pass open cursor via USING in execute staement
Date: Thu, 01 Jun 2023 16:23:44 +0200
Message-ID: <5c247f374cd29995f4161d02ed104c1052660509.camel@cybertec.at> (raw)
In-Reply-To: <168557387260.1230014.3975398352224062825@wrigleys.postgresql.org>
References: <168557387260.1230014.3975398352224062825@wrigleys.postgresql.org>

On Wed, 2023-05-31 at 22:57 +0000, PG Doc comments form wrote:
> Page: https://www.postgresql.org/docs/15/plpgsql-statements.html
> 
> Should be documented if this statement is allowed or not (if not, maybe set
> as desired feature :-) )
> 
> EXECUTE format('update %I set col1=$1, col2=now() WHERE current of $3',
> tabname)
>    USING myVal, myOpenCursor;

That is not supported.  Parameters can only be used in a place where constants
(SQL literals) might appear, not instead of identifiers (names of tables, columns etc.)

I looked, and that is really not documented anywhere.
One of PREPARE or the extended query protocol might be good places.

Yours,
Laurenz Albe





view thread (4+ messages)  latest in thread

Message-ID: <5c247f374cd29995f4161d02ed104c1052660509.camel@cybertec.at>
Permalink:  ../5c247f374cd29995f4161d02ed104c1052660509.camel@cybertec.at/
Also on:    postgresql.org/message-id/5c247f374cd29995f4161d02ed104c1052660509.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: laurenz.albe@cybertec.at, domenico.l76@gmail.com, pgsql-docs@lists.postgresql.org
  Subject: Re: pass open cursor via USING in execute staement
  In-Reply-To: <5c247f374cd29995f4161d02ed104c1052660509.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox