From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Jenda Krynicky <Jenda@Krynicky.cz>
To: pgsql-general@lists.postgresql.org
Subject: Re: INSERT ... ON CONFLICT doesn't work
Date: Wed, 1 Dec 2021 11:31:27 -0800
Message-ID: <e096c99b-75ec-7507-cd6b-c446f2c4b745@aklaver.com> (raw)
In-Reply-To: <61A7CB18.20091.3401B246@Jenda.Krynicky.cz>
References: <61A7CB18.20091.3401B246@Jenda.Krynicky.cz>
On 12/1/21 11:20 AM, Jenda Krynicky wrote:
> So let's suppose I have a table like this:
>
>
> So pretty please with a cherry on top, how do I explain to postgres
> 13.4, that yes indeed by "Uuid" I mean the stinking column "Uuid".
The basic issue is described here:
https://www.postgresql.org/docs/current/plpgsql-implementation.html#PLPGSQL-VAR-SUBST
"Since the names of variables are syntactically no different from the
names of table columns, there can be ambiguity in statements that also
refer to tables: is a given name meant to refer to a table column, or a
variable? Let's change the previous example to ..."
ERROR: column reference "Uuid" is ambiguous
LINE 3: ON CONFLICT ("Uuid")
Is occurring because there is ambiguity between:
"Uuid" text
in RETURNS TABLE and
"Lockers"."Uuid"
I would say the easiest way out of this is to change:
"Uuid" text --> "uuid_out" text
>
> Jenda
>
--
Adrian Klaver
adrian.klaver@aklaver.com
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: adrian.klaver@aklaver.com, Jenda@Krynicky.cz
Subject: Re: INSERT ... ON CONFLICT doesn't work
In-Reply-To: <e096c99b-75ec-7507-cd6b-c446f2c4b745@aklaver.com>
References: <61A7CB18.20091.3401B246@Jenda.Krynicky.cz> <e096c99b-75ec-7507-cd6b-c446f2c4b745@aklaver.com>
* 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