createlang  --  Defines a new programming language for use by functions within a database.


  createlang [ connection options ] [ langname [ dbname ] ]
createlang [ connection options ] --list|-l [ dbname ]



Use this parameter to name the programming language you are defining. If a name is not specified, createlang will prompt for one.

-d, --dbname dbname

Use this parameter to specify the name of the database the new language will be added to.

-l, --list

Pass this parameter to list all currently installed languages in the specified database.

The createlang command also provides the following arguments for connection parameters:

-h, --host host

Use this parameter to provide the hostname of the machine postmaster is running on.

-p, --port port

Use this parameter to provide the TCP/IP port or socket file that postmaster is listening on.

-U, --username username

Use this parameter to specify the username to connect as.

-W, --password

Pass this parameter to have createlang prompt for a password before completing.


Most errors encountered with this program are self-explanatory. Pass the --echo to view all SQL statements the program is sending to the backend.


Use createlang as an alternate way of adding new programming langage definitions into a database. As of the current release of PostgreSQL (7.1), createlang accepts the following languages:

The advantage of using createlang over SQL commands for adding languages is that it performs a number of checks that those commands do not explicitly check. Additionally, it can be called from the command line and is generally easier to use.


The following example demonstrates how to install the PL/pgSQL language into the booktown database.

$ createlang plpgsql booktown