Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q4jDT-0003xf-KG for pgsql-docs@arkaria.postgresql.org; Thu, 01 Jun 2023 14:23:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q4jDS-0004no-GF for pgsql-docs@arkaria.postgresql.org; Thu, 01 Jun 2023 14:23:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q4jDS-0004nb-61 for pgsql-docs@lists.postgresql.org; Thu, 01 Jun 2023 14:23:50 +0000 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1q4jDO-003Vec-Hi for pgsql-docs@lists.postgresql.org; Thu, 01 Jun 2023 14:23:49 +0000 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-96ff9c0a103so124319966b.0 for ; Thu, 01 Jun 2023 07:23:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20221208.gappssmtp.com; s=20221208; t=1685629426; x=1688221426; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=YWr6QLjtO85mknnBjSz/1xfpSrhN79q/UzYPF8hGW18=; b=Klx2cctr/gaqRtTZAxDy7yOKDpd9GzKcvQaMlDqKKj3KxlAF2lkIqybeMKh0Qlzw+8 NmigZLsALm6Y2p8h4W2yrMO+2Cm8y7TF5orX2xzuZbeqes9w/OjxnhSGmc4YJGkXqG6K EEykOpTbwn3gTdr2U0FX7Q18cIs6ZnzNO9wuVJvaDYmrmGJLCboimKjXCMZK45lY3C15 SZqXCASIum1FZLwMXJvkSJA0hZa4Ns6rriVQIYwxX2Au8ljOGtCivOJ3xRyA//GqZiRK eWrX8cXgFdl2rd+5RLnSSZ1Mr0Cm0M3MDBzIzeABpCPC+SqiiMiax9bLjgJDaPaH/J9I 8M3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685629426; x=1688221426; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=YWr6QLjtO85mknnBjSz/1xfpSrhN79q/UzYPF8hGW18=; b=PszrWZ/jLlYMQaBB5l+gdbSTFZJtN4w6dgcTD0y7JbK5PWQjWwetpM4fh0dfuql7Y7 GuqPSlpcYlZLaDWaBQYpdlMJo98PqNyiWRyABcG/vqKM5mKeSawPb4A64o/Fw4ueJtBN uEIhwDR7/qBJ5SE9LT0nULh9YL1WM/a91doUWAgBL5qwGRAPigLbSb8Cf0FymvFNjAOH 0pYrt0Lh3NVB4V4z5x3bMrl8LUSHMPT/WlTueXQTj1R3O9MNJ9USXLGI1Oyt9/lhbgtW Uf1TkMD78KDLMzDd0yfZsyb6DYvhYyyBtnSpNUeV5YlDbZYBE5b2HTR8J6yQhCdYr9hp 2Tzw== X-Gm-Message-State: AC+VfDxpfVJZbnxQSH+F9Rfn0Z84VoA1ps6dIoThXBnddtHdmoyjtaSz SA7/wqz7a2f0bMfPWdJ/t1GkGw== X-Google-Smtp-Source: ACHHUZ7oct74Id560sL7Fh/mpa9CrjCWCftR67Bbdkgvw6t2ZTK9A4eqh3nTNJNevqKdZ6aacQfPwA== X-Received: by 2002:a17:907:e93:b0:971:484:6391 with SMTP id ho19-20020a1709070e9300b0097104846391mr8466511ejc.20.1685629426090; Thu, 01 Jun 2023 07:23:46 -0700 (PDT) Received: from localhost.localdomain ([2001:871:5e:e788:ec0f:bb76:46ee:40fc]) by smtp.gmail.com with ESMTPSA id q9-20020a170906940900b009545230e682sm10708338ejx.91.2023.06.01.07.23.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 07:23:45 -0700 (PDT) Message-ID: <5c247f374cd29995f4161d02ed104c1052660509.camel@cybertec.at> Subject: Re: pass open cursor via USING in execute staement From: Laurenz Albe To: domenico.l76@gmail.com, pgsql-docs@lists.postgresql.org Date: Thu, 01 Jun 2023 16:23:44 +0200 In-Reply-To: <168557387260.1230014.3975398352224062825@wrigleys.postgresql.org> References: <168557387260.1230014.3975398352224062825@wrigleys.postgresql.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 (3.46.4-1.fc37) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 2023-05-31 at 22:57 +0000, PG Doc comments form wrote: > Page: https://www.postgresql.org/docs/15/plpgsql-statements.html >=20 > Should be documented if this statement is allowed or not (if not, maybe s= et > as desired feature :-) ) >=20 > EXECUTE format('update %I set col1=3D$1, col2=3Dnow() WHERE current of $3= ', > tabname) > =C2=A0=C2=A0 USING myVal, myOpenCursor; That is not supported. Parameters can only be used in a place where consta= nts (SQL literals) might appear, not instead of identifiers (names of tables, c= olumns 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