LKBEN11153: Howto list all the PL Languages for a postgres database
LKB | Created: 02/04/2020 | Version: 0 | Language: EN | Rating: 0 | Outdated: False | Marked for deletion: False
Author: Wim Peeters - Keskon GmbH & Co. KG
Symptom
You would like to use a certain language for using postgresql e.g. plpgsql
Cause
none
Solution
You can create the language with the command:
CREATE LANGUAGE plpgsql;
You can opt for creating this language in your template database which is used to create new databases. In this case you will always have the language available in new databases.
Createlang is a command line program that is located in the bin folder of your PostgreSQL installation directory.
I you would like to see a list of procedural languages that you already have in PostgreSQL you can use the following select statement:
SELECT * FROM pg_catalog.pg_pltemplate
The output might look like this:
postgres=# SELECT * FROM pg_catalog.pg_pltemplate;
tmplname | tmpltrusted | tmpldbacreate | tmplhandler | tmplvalidator | tmpllibrary | tmplacl
-----------+-------------+---------------+-----------------------+-------------------+------------------+---------
plpgsql | t | t | plpgsql_call_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_validator | $libdir/plperl |
plperlu | f | f | plperl_call_handler | plperl_validator | $libdir/plperl |
plpythonu | f | f | plpython_call_handler | | $libdir/plpython |
(6 Zeilen)
and can, probably will, be different on your system.
About the Author
Wim Peeters is electronics engineer with an additional master in IT and over 30 years of experience including time spent in support, development, consulting, training and database administration. Wim has worked with SQL Server since version 6.5. He has developed in C/C++, Java and C# on Windows and Linux in different European countries and different European languages. He writes knowledge base articles to solve IT problems and publishes them on the Lubby Knowledge Platform where he is one of the most important contributors and the main developer.