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

From: Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Missing feature - how to differentiate insert/update in plpgsql function?
Date: 2017-02-15 14:59:12
Message-ID: 20170215145911.thuaqw5k4pppyrct@hermes.hilbert.loc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Feb 15, 2017 at 06:44:09AM -0800, Adrian Klaver wrote:

> > Well, this wouldn't work for me as pkey will not change.
>
> Alright you lost me. If the pkey does not change then how do you get new
> rows(INSERT)?

I think OP is using natural (rather than surrogate) primary
keys. So, the PK already exists or else is created. But the
(then-returned) _value_ of either is the same.

Karsten
--
GPG key ID E4071346 @ eu.pool.sks-keyservers.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346

In response to

Browse pgsql-general by date

  From Date Subject
Next Message hubert depesz lubaczewski 2017-02-15 15:04:07 Re: Missing feature - how to differentiate insert/update in plpgsql function?
Previous Message Albe Laurenz 2017-02-15 14:58:08 Re: Missing feature - how to differentiate insert/update in plpgsql function?