pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alexi Theodore <alexitheodore@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: Bug report: variable_conflict + ON CONFLICT
Date: Wed, 05 Jan 2022 20:27:33 -0500
Message-ID: <1000505.1641432453@sss.pgh.pa.us> (raw)
In-Reply-To: <2A512572-5AE4-4072-9C04-C746C9E67F56@gmail.com>
References: <2A512572-5AE4-4072-9C04-C746C9E67F56@gmail.com>

Alexi Theodore <alexitheodore@gmail.com> writes:
> I'd like to report what I think is a bug. I've put together a script which highlights things pretty clearly. The short synopsis is that when using "#variable_conflict use_variable" in a function or procedure, the correct choice of variable vs column name is done everywhere (that I know of) except in the ON CONFLICT (<column name>) part of an INSERT statement. That one part only seems to not follow the conflict resolution pattern. 

The names in ON CONFLICT are not values, and it would not make
sense to substitute plpgsql variable values for them.  A related
example is that if you write INSERT INTO t (a,b) VALUES (1,2),
none of t, a, or b are candidates to be replaced by plpgsql
variables.

			regards, tom lane





view thread (4+ messages)  latest in thread

Message-ID: <1000505.1641432453@sss.pgh.pa.us>
Permalink:  ../1000505.1641432453@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1000505.1641432453@sss.pgh.pa.us

 · 

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-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, alexitheodore@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: Bug report: variable_conflict + ON CONFLICT
  In-Reply-To: <1000505.1641432453@sss.pgh.pa.us>

* 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