Re: BUG #14327: UPSERT requires full path to column

From: Peter Geoghegan <pg(at)heroku(dot)com>
To: egor(dot)pugin(at)gmail(dot)com
Cc: pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #14327: UPSERT requires full path to column
Date: 2016-09-19 10:06:19
Message-ID: CAM3SWZTS10xLUxOHKa-t7E-K7L7LOE2Ag4WFm-mUYOGNH1UXEQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Sep 19, 2016 at 1:06 AM, <egor(dot)pugin(at)gmail(dot)com> wrote:
> 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.

Use an alias. e.g.:

INSERT INTO statistics."MostPopularDependencies" as mpd ...

You can then reference columns using mpd.downloads_week, etc

--
Peter Geoghegan

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Egor Pugin 2016-09-19 10:08:59 Re: BUG #14327: UPSERT requires full path to column
Previous Message egor.pugin 2016-09-19 08:06:53 BUG #14327: UPSERT requires full path to column