Re: PL/pgSQL 2 - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: PL/pgSQL 2
Date
Msg-id 54051821.1000200@dunslane.net
Whole thread Raw
In response to Re: PL/pgSQL 2  (Neil Tiffin <neilt@neiltiffin.com>)
Responses Re: PL/pgSQL 2
Re: PL/pgSQL 2
List pgsql-hackers
On 09/01/2014 08:09 PM, Neil Tiffin wrote:
> On Sep 1, 2014, at 10:45 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
>> What is actually being proposed, AFAICS, is a one-shot fix for a bunch
>> of unfortunate choices.  That might be worth doing, but let's not fool
>> ourselves about whether it’s one-shot or not.
> Well, one shot every 18 years is not so bad.
>
> I am only a casual user and as such probably do not merit much consideration from the experts here.  I only work with
PL/pgSQLoccasionally, but never go weeks without doing it and sometimes it is all I do for weeks. 
>
> That said and this being the internet, IMO working in PL/pgSQL is only slightly better than stabbing myself in the
legwith a knife compared to other non-PL/pgSQL languages I work in.  Mostly my hate is directed at the silly quoting.
Butit has lots of other quirks that are not all that obvious unless you work with it all day every day. 
>
> Now I could use other languages as was suggested upstream.  Lets see, I use R all the time, but R is not a first
classlanguage, not in core, and its slow. Python 3 would be acceptable to me, but its untrusted. tcl I don’t know and
don’twant to learn as no one else seems to use it (in my world anyway).  perl is the only possibility left and again,
noone in my world is using Perl and it’s not clear if there is a performance penalty.  The docs say the best language
forperformance is PL/pgSQL after pure SQL. 
>
> Really, this is from the docs
>
> a_output := a_output || '' if v_'' ||
>      referrer_keys.kind || '' like ''''''''''
>      || referrer_keys.key_string || ''''''''''
>      then return ''''''  || referrer_keys.referrer_type
>      || ‘'''''; end if;'';



The docs also tell you how to avoid having to do this, using dollar quoting.


>
> That should be enough alone to suggest postgreSQL start working on a modern, in core, fast, fully supported language.
Of course PL/pgSQL works, but so did one-line 5k perl programs that nobody likes today.  Everything can be done in
assembler,but no one suggests that today.  Today, it is all about programmer productivity.  PL/pgSQL has a lot of
unnecessarystuff that sucks the life out of programmer productivity.  And this should be very much a concern of the
professionalsthat support PostgreSQL 
>
> For example:
>
> DECLARE
> declarations
> BEGIN
> statements
> END
>
> This looks a lot like COBOL or Pascal, and today is mostly unnecessary.

It looks like Ada, and that's not an accident. (Nor is it a bad thing.)


The very last thing we should be doing is to invent a new language.
There are already plenty to choose from.

cheers

andrew



pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: Patch for psql History Display on MacOSX
Next
From: Noah Misch
Date:
Subject: orangutan seizes up during isolation-check