Re: [HACKERS] INSERT ... ON CONFLICT UPDATE/IGNORE 4.0

From: Geoff Winkless <pgsqladmin(at)geoff(dot)dj>
To: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: [HACKERS] INSERT ... ON CONFLICT UPDATE/IGNORE 4.0
Date: 2015-05-08 15:31:13
Message-ID: CAEzk6ffe0Xz8Eyu7VG887XGh3vYcv-ut8fVqyeuso4JPiL4Z8Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-hackers

Omitted only has one m.

There's an extra space in "error . (See".

Otherwise it reads fine to me, although I've only skimmed it.

I may have misunderstood: there is only one ON CONFLICT action allowed? I
thought the previous version suggested multiple possible targets and
actions, this suggests that while there can be multiple targets the action
is always the same.

So I thought I could have

INSERT INTO distributors (did, dname)
ON CONFLICT (did) UPDATE dname=target.dname
ON CONFLICT (dname) DO NOTHING;

Did I misunderstand?

Finally there's no

INSERT INTO distributors (did, dname)
SELECT did, dname FROM otherdists
ON CONFLICT (did) DO NOTHING;

example (or similar); do we think people will be smart enough to realise
that's possible without one?

Geoff

On 8 May 2015 at 16:03, Andres Freund <andres(at)anarazel(dot)de> wrote:

> So I've committed the patch yesterday evening. I'm pretty sure there'll
> be some more minor things to change. But overall I feel good about the
> current state.
>
> It'd be quite helpful if others could read the docs, specifically for
> insert, and comment whether they're understandable. I've spent a fair
> amount of time trying to make them somewhat simpler, but I do think I
> only succeeded partially. And there's also my own brand of english to
> consider ;)
>
> Phew.
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Geoff Winkless 2015-05-08 15:33:44 Re: [HACKERS] INSERT ... ON CONFLICT UPDATE/IGNORE 4.0
Previous Message Andres Freund 2015-05-08 15:03:40 Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0

Browse pgsql-hackers by date

  From Date Subject
Next Message Geoff Winkless 2015-05-08 15:33:44 Re: [HACKERS] INSERT ... ON CONFLICT UPDATE/IGNORE 4.0
Previous Message Tom Lane 2015-05-08 15:29:45 Re: transforms vs. CLOBBER_CACHE_ALWAYS