Re: PL/pgSQL 2

Поиск
Список
Период
Сортировка
От Neil Tiffin
Тема Re: PL/pgSQL 2
Дата
Msg-id 0FDE77BF-30AB-4D07-9417-D93A35E46F90@neiltiffin.com
обсуждение исходный текст
Ответ на Re: PL/pgSQL 2  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: PL/pgSQL 2  (Andrew Dunstan <andrew@dunslane.net>)
Re: PL/pgSQL 2  (Craig Ringer <craig@2ndquadrant.com>)
Список pgsql-hackers
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 leg
witha knife compared to other non-PL/pgSQL languages I work in.  Mostly my hate is directed at the silly quoting.  But
ithas 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 class
language,not in core, and its slow. Python 3 would be acceptable to me, but its untrusted. tcl I don’t know and don’t
wantto learn as no one else seems to use it (in my world anyway).  perl is the only possibility left and again, no one
inmy world is using Perl and it’s not clear if there is a performance penalty.  The docs say the best language for
performanceis 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;''; 

That should be enough alone to suggest postgreSQL start working on a modern, in core, fast, fully supported language.
Ofcourse 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.

So my opinion would be to keep PL/pgSQL and adopt a new PL language that is fully supported, fast, and modern, that
willover time replace PL/pgSQL. 

Neil







В списке pgsql-hackers по дате отправления:

Предыдущее
От: Marko Tiikkaja
Дата:
Сообщение: Re: PL/PgSQL: RAISE and the number of parameters
Следующее
От: Noah Misch
Дата:
Сообщение: Re: Patch for psql History Display on MacOSX