Re: [GENERAL] Missing feature - how to differentiate insert/updatein plpgsql function? - Mailing list pgsql-general

From Albe Laurenz
Subject Re: [GENERAL] Missing feature - how to differentiate insert/updatein plpgsql function?
Date
Msg-id A737B7A37273E048B164557ADEF4A58B539F9FF8@ntex2010i.host.magwien.gv.at
Whole thread Raw
In response to [GENERAL] Missing feature - how to differentiate insert/update in plpgsqlfunction?  (hubert depesz lubaczewski <depesz@depesz.com>)
Responses Re: [GENERAL] Missing feature - how to differentiate insert/updatein plpgsql function?  (hubert depesz lubaczewski <depesz@depesz.com>)
List pgsql-general
hubert depesz lubaczewski wrote:
> I have a function, in PostgreSQL 9.6, which does:
> 
> INSERT INTO table () values (...)
> ON CONFLICT DO UPDATE ...;
> 
> The thing is that the function should return information whether the row
> was modified, or created - and currently it seems that this is not
> available. Or am I missing something?

Maybe the following answer can help:
http://stackoverflow.com/a/39204667/6464308

I don't really know how stable that (undocumented) behaviour will be, though.

Yours,
Laurenz Albe

pgsql-general by date:

Previous
From: hubert depesz lubaczewski
Date:
Subject: Re: [GENERAL] Missing feature - how to differentiate insert/updatein plpgsql function?
Next
From: Karsten Hilbert
Date:
Subject: Re: [GENERAL] Missing feature - how to differentiate insert/updatein plpgsql function?