From: egor.pugin@gmail.com
To: pgsql-bugs@postgresql.org
Subject: BUG #14327: UPSERT requires full path to column
Date: Mon, 19 Sep 2016 08:06:53 +0000
Message-ID: <20160919080653.1348.83028@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
The following bug has been logged on the website:
Bug reference: 14327
Logged by: Egor Pugin
Email address: egor.pugin@gmail.com
PostgreSQL version: 9.5.4
Operating system: win10
Description:
Hi,
I've noticed upsert query won't work if I do not write 'schema.TABLE.column'
instead of simple 'column' in 'on conflict do update set' query.
Working:
insert into statistics."MostPopularDependencies"
(id, indirect, downloads_week)
values ($1, $2, 1)
on conflict (id, indirect) do update
set downloads_week = statistics."MostPopularDependencies".downloads_week +
1
where statistics."MostPopularDependencies".id = $1 and
statistics."MostPopularDependencies".indirect = $2;
Not working:
insert into statistics."MostPopularDependencies"
(id, indirect, downloads_week)
values ($1, $2, 1)
on conflict
(id, indirect) -- also w/out this, it does not work too, but isn't it
optional element?
do update
set downloads_week = downloads_week + 1
where id = $1 and indirect = $2;
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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-bugs@postgresql.org
Cc: egor.pugin@gmail.com
Subject: Re: BUG #14327: UPSERT requires full path to column
In-Reply-To: <20160919080653.1348.83028@wrigleys.postgresql.org>
References: <20160919080653.1348.83028@wrigleys.postgresql.org>
* 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