Re: [HACKERS] merging some features from plpgsql2 project - Mailing list pgsql-hackers

From Jim Nasby
Subject Re: [HACKERS] merging some features from plpgsql2 project
Date
Msg-id 9f82eab5-4dd3-5b06-e929-44052636eef4@BlueTreble.com
Whole thread Raw
In response to Re: [HACKERS] merging some features from plpgsql2 project  (Marko Tiikkaja <marko@joh.to>)
Responses Re: [HACKERS] merging some features from plpgsql2 project  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
On 1/9/17 6:07 PM, Marko Tiikkaja wrote:
>     One use case is NEW and OLD in triggers. Checking to see if one or
>     the other is set is easier than checking TG_OP. It's also going to
>     be faster (probably MUCH faster; IIRC the comparison currently
>     happens via SPI).
>
>
> This sounds useless.

I guess you've not written much non-trivial trigger code then... the 
amount of code duplication you end up with is quite ridiculous. It's 
also a good example of why treating this as an exception and trapping 
isn't a good solution either: you can already do that with triggers today.

Being able to check the existence of a variable is a very common idiom 
in other languages, so I'm don't see why plpgsql shouldn't have it.
-- 
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532)



pgsql-hackers by date:

Previous
From: Jim Nasby
Date:
Subject: Re: [HACKERS] Increase pltcl test coverage
Next
From: Jim Nasby
Date:
Subject: Re: [HACKERS] RustgreSQL