pgadmin4/docs/en_US/language_dialog.rst

98 lines
3.9 KiB
ReStructuredText
Raw Normal View History

2016-09-16 05:14:49 -05:00
.. _language:
2018-06-15 03:14:12 -05:00
************************
`Language Dialog`:index:
************************
2016-09-16 05:14:49 -05:00
Use the CREATE LANGUAGE dialog to register a new procedural language.
The *Language* dialog organizes the registration of a procedural language
through the following dialog tabs: *General*, *Definition*, and *Security*.
The *SQL* tab displays the SQL code generated by dialog selections.
2016-09-16 05:14:49 -05:00
.. image:: images/language_general.png
:alt: Language dialog general tab
:align: center
2016-09-16 05:14:49 -05:00
Use the fields in the *General* tab to identify a language:
* Use the drop-down listbox next to *Name* to select a language script.
* Use the drop-down listbox next to *Owner* to select a role.
* Store notes about the language in the *Comment* field.
Click the *Definition* tab to continue.
.. image:: images/language_definition.png
:alt: Language dialog definition tab
:align: center
2016-09-16 05:14:49 -05:00
Use the fields in the *Definition* tab to define parameters:
* Move the *Trusted?* switch to the *No* position to specify only users with
PostgreSQL superuser privilege can use this language. The default is *Yes*.
* When enabled, use the drop-down listbox next to *Handler Function* to select
the function that will be called to execute the language's functions.
* When enabled, use the drop-down listbox next to *Inline Function* to select
the function that will be called to execute an anonymous code block (DO
command) in this language.
* When enabled, use the drop-down listbox next to *Validator Function* to
select the function that will be called when a new function in the language
is created, to validate the new function.
2016-09-16 05:14:49 -05:00
Click the *Security* tab to continue.
.. image:: images/language_security.png
:alt: Language dialog security tab
:align: center
2016-09-16 05:14:49 -05:00
Use the *Security* tab to assign privileges and define security labels.
2016-09-16 05:14:49 -05:00
Use the *Privileges* panel to assign privileges to a role. Click the *Add* icon
(+) to set privileges for database objects:
2016-09-16 05:14:49 -05:00
* Select the name of the role from the drop-down listbox in the *Grantee* field.
* Click inside the *Privileges* field. Check the boxes to the left of one or
more privileges to grant the selected privilege to the specified user.
* The current user, who is the default grantor for granting the privilege, is displayed in the *Grantor* field.
2016-09-16 05:14:49 -05:00
Click the *Add* icon (+) to assign additional privileges; to discard a
privilege, click the trash icon to the left of the row and confirm deletion in
the *Delete Row* popup.
2016-09-16 05:14:49 -05:00
Use the *Security Labels* panel to define security labels applied to the
function. Click the *Add* icon (+) to add each security label selection:
2016-09-16 05:14:49 -05:00
* Specify a security label provider in the *Provider* field. The named provider
must be loaded and must consent to the proposed labeling operation.
* Specify a a security label in the *Security Label* field. The meaning of a
given label is at the discretion of the label provider. PostgreSQL places no
restrictions on whether or how a label provider must interpret security
labels; it merely provides a mechanism for storing them.
2016-09-16 05:14:49 -05:00
Click the *Add* icon (+) to assign additional security labels; to discard a
security label, click the trash icon to the left of the row and confirm deletion
in the *Delete Row* popup.
2016-09-16 05:14:49 -05:00
Click the *SQL* tab to continue.
Your entries in the *Language* dialog generate a SQL command (see an example
below). Use the *SQL* tab for review; revisit or switch tabs to make any changes
to the SQL command.
2016-09-16 05:14:49 -05:00
Example
*******
2016-09-16 05:14:49 -05:00
The following is an example of the sql command generated by user selections in
the *Language* dialog:
2016-09-16 05:14:49 -05:00
.. image:: images/language_sql.png
:alt: Language dialog sql tab
:align: center
2016-09-16 05:14:49 -05:00
The example shown demonstrates creating the trusted procedural language named *mylan*.
2016-09-16 05:14:49 -05:00
* Click the *Info* button (i) to access online help.
2016-09-16 05:14:49 -05:00
* Click the *Save* button to save work.
* Click the *Close* button to exit without saving work.
2016-09-16 05:14:49 -05:00
* Click the *Reset* button to restore configuration parameters.