PLR does not install language templates

Lists: pgsql-hackers
From: Josh Berkus <josh(at)agliodbs(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Joe Conway <mail(at)joeconway(dot)com>
Subject: PLR does not install language templates
Date: 2013-06-24 19:24:29
Message-ID: 51C89CED.4060106@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Joe, all:

Ok, this is wierd. This is PostgreSQL 9.2.4, on Centos 6, installed
using the packages at yum.postgresql.org. Is the below an issue with
PL/R, the packages, or PostgreSQL?

Seems like if a language is actually *installed*, it needs to have
templates ...

analytics=# \dL
List of languages
Name | Owner | Trusted | Description
-----------+----------+---------+------------------------------------------
plpgsql | postgres | t | PL/pgSQL procedural language
plpythonu | postgres | f | PL/PythonU untrusted procedural language
plr | postgres | f |

analytics=# select * from pg_pltemplate ;
tmplname | tmpltrusted | tmpldbacreate | tmplhandler |
tmplinline | tmplvalidator | tmpllibrary | tmp
lacl
------------+-------------+---------------+------------------------+--------------------------+---------------------+-------------------+----
-----
plpgsql | t | t | plpgsql_call_handler |
plpgsql_inline_handler | plpgsql_validator | $libdir/plpgsql |
pltcl | t | t | pltcl_call_handler |
| | $libdir/pltcl |
pltclu | f | f | pltclu_call_handler |
| | $libdir/pltcl |
plperl | t | t | plperl_call_handler |
plperl_inline_handler | plperl_validator | $libdir/plperl |
plperlu | f | f | plperlu_call_handler |
plperlu_inline_handler | plperlu_validator | $libdir/plperl |
plpythonu | f | f | plpython_call_handler |
plpython_inline_handler | plpython_validator | $libdir/plpython2 |
plpython2u | f | f | plpython2_call_handler |
plpython2_inline_handler | plpython2_validator | $libdir/plpython2 |
plpython3u | f | f | plpython3_call_handler |
plpython3_inline_handler | plpython3_validator | $libdir/plpython3 |
(8 rows)

--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com


From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Joe Conway <mail(at)joeconway(dot)com>
Subject: Re: PLR does not install language templates
Date: 2013-06-24 19:42:18
Message-ID: 20130624194218.GK6471@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 2013-06-24 12:24:29 -0700, Josh Berkus wrote:
> Joe, all:
>
> Ok, this is wierd. This is PostgreSQL 9.2.4, on Centos 6, installed
> using the packages at yum.postgresql.org. Is the below an issue with
> PL/R, the packages, or PostgreSQL?
>
> Seems like if a language is actually *installed*, it needs to have
> templates ...

No. Why? We don't really need templates at all anymore since the advent
of extensions.

The original reason for pltemplates was that the user shouldn't have to
manually know the handler names you need to pass to CREATE LANGUAGE. Now
we have CREATE EXTENSION making that unneccessary. So it's only backward
compat with older dumps that contain CREATE LANGUAGE verbatim instead of
CREATE EXTENSION.

How should pl/r automagically be installed into pl_template anyway? The
initdb may very well have been executed before installing pl/r.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Joe Conway <mail(at)joeconway(dot)com>
Subject: Re: PLR does not install language templates
Date: 2013-06-24 19:45:47
Message-ID: 19545.1372103147@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Josh Berkus <josh(at)agliodbs(dot)com> writes:
> Ok, this is wierd. This is PostgreSQL 9.2.4, on Centos 6, installed
> using the packages at yum.postgresql.org. Is the below an issue with
> PL/R, the packages, or PostgreSQL?

> Seems like if a language is actually *installed*, it needs to have
> templates ...

Not necessarily --- that's an optional feature. In fact, I am not eager
to encourage third-party PLs to start installing pg_pltemplate entries
anymore, because that's mostly vestigial in the extensions universe.
We should be encouraging use of CREATE EXTENSION not CREATE LANGUAGE to
install PLs, and for that you don't need a pltemplate entry. It's
likely that pg_pltemplate will disappear entirely before long.

regards, tom lane


From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org, Joe Conway <mail(at)joeconway(dot)com>
Subject: Re: PLR does not install language templates
Date: 2013-06-24 19:58:50
Message-ID: 51C8A4FA.40004@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


> Not necessarily --- that's an optional feature. In fact, I am not eager
> to encourage third-party PLs to start installing pg_pltemplate entries
> anymore, because that's mostly vestigial in the extensions universe.
> We should be encouraging use of CREATE EXTENSION not CREATE LANGUAGE to
> install PLs, and for that you don't need a pltemplate entry. It's
> likely that pg_pltemplate will disappear entirely before long.

Ah, ok. Thanks!

--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com