Re: Re: [COMMITTERS] pgsql: Add support for INSERT ... ON CONFLICT DO NOTHING/UPDATE.

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: Re: [COMMITTERS] pgsql: Add support for INSERT ... ON CONFLICT DO NOTHING/UPDATE.
Дата
Msg-id 20150522004811.GD2028@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: Re: [COMMITTERS] pgsql: Add support for INSERT ... ON CONFLICT DO NOTHING/UPDATE.  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: Re: [COMMITTERS] pgsql: Add support for INSERT ... ON CONFLICT DO NOTHING/UPDATE.  (Peter Geoghegan <pg@heroku.com>)
Список pgsql-hackers
On 2015-05-21 20:28:41 -0300, Alvaro Herrera wrote:
> That said, I'm not sure about having it be the same, either: first, I
> don't think we need to update the fe-exec.c code at all -- I mean, all
> the things I see there are very old compatibility stuff; reporting the
> OID of the just-inserted row?  Seriously, who has OIDs in user tables
> anymore?  Surely we wouldn't try to do that for INSERT ON CONFLICT DO
> UPDATE at all ... if anyone wants that functionality, they can use
> RETURNING, which is far saner.

The oid currently is reported for UPSERT... I agree it's not worth much,
but it seems pointless to break it for a single command.

> As for PQcmdTuples, what would a single number returned mean?  Are we
> returning the sum of both inserted and updated tuples?

Yes.

> Isn't this a bit odd?

Imo it's pretty much in line with what's done with INSTEAD OF, FDWs and
such.

> If the number is useful, then perhaps we should distinguish the cases;
> and if it's not useful, why not just return zero?

There's libraries/frameworks checking if an insert succeeded by looking
at that number, and it seems like a bad idea to needlessly break those.


So I think we're good with ripping it out. Peter?



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Postgres and TLSv1.2
Следующее
От: Jan Bilek
Дата:
Сообщение: Re: Postgres and TLSv1.2