Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0
Дата
Msg-id 20150508155130.GN12950@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0  (Geoff Winkless <pgsqladmin@geoff.dj>)
Ответы Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0  (Geoff Winkless <pgsqladmin@geoff.dj>)
Список pgsql-hackers
On 2015-05-08 16:36:07 +0100, Geoff Winkless wrote:
> 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.

Thanks, I'll push fixes for those.

> I may have misunderstood: there is only one ON CONFLICT action
> allowed?

Yes.

> 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.

I don't think any version of the patch included that functionality. I
can see it being useful, but it'd make a bunch of things more
complicated, so I doubt we'll get there for 9.5.

> So I thought I could have
> 
> INSERT INTO distributors (did, dname)
>   ON CONFLICT (did) DO 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?​

Hm. I'm tempted to say that the synopis makes that clear enough.  I
personally never check such examples though, so maybe I'm the wrong
person to judge.



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Christian Ullrich
Дата:
Сообщение: Re: transforms vs. CLOBBER_CACHE_ALWAYS
Следующее
От: Geoff Winkless
Дата:
Сообщение: Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0