Обсуждение: PLR does not install language templates

Поиск
Список
Период
Сортировка

PLR does not install language templates

От
Josh Berkus
Дата:
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
procedurallanguageplpythonu | postgres | f       | PL/PythonU untrusted procedural languageplr       | 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



Re: PLR does not install language templates

От
Andres Freund
Дата:
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



Re: PLR does not install language templates

От
Tom Lane
Дата:
Josh Berkus <josh@agliodbs.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



Re: PLR does not install language templates

От
Josh Berkus
Дата:
> 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