Missing feature - how to differentiate insert/update in plpgsql function?

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: Pgsql General <pgsql-general(at)postgresql(dot)org>
Subject: Missing feature - how to differentiate insert/update in plpgsql function?
Date: 2017-02-15 14:05:02
Message-ID: 20170215140502.GA25364@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,
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?

Best regards,

depesz

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2017-02-15 14:24:14 Re: Missing feature - how to differentiate insert/update in plpgsql function?
Previous Message Karsten Hilbert 2017-02-15 12:11:25 Re: Bad planning data resulting in OOM killing of postgres