pgadmin4/docs/en_US/package_dialog.rst
2016-09-16 11:14:49 +01:00

57 lines
2.4 KiB
ReStructuredText

.. _package:
******************
The Package Dialog
******************
Use the *Package* dialog to create a set of related database objects.
The *Package* dialog organizes the development of a package through the following dialog tabs: *General*, *Code*, and *Security*. The *SQL* tab displays the SQL code generated by dialog selections.
.. image:: images/package_general.png
Use the fields in the *General* tab to identify the package:
* Use the *Name* field to add a descriptive name for the package. The name of a new package must not match any existing package in the same schema.
* Store notes about the package in the *Comment* field.
Click the *Code* tab to continue.
.. image:: images/package_code.png
Use the fields in the *Code* tab to specify the package contents and to provide implementation details:
* Use the *Header* field to write the code that will call the database objects.
* Use the *Body* field to write the code that will implement functions, procedures, and other package contents.
Click the *Security* tab to continue.
.. image:: images/package_security.png
Use the fields in the *Security* tab to to assign privileges to a role. Click the *Add* icon (+) to set privileges for the package:
* 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.
* Select the name of the role from the drop-down listbox in the *Grantor* field. The default grantor is the owner of the database.
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.
Click the *SQL* tab to continue.
Your entries in the *Package* 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.
**Example**
The following is an example of the sql command generated by user selections in the *Package* dialog:
.. image:: images/package_sql.png
The example shown demonstrates creating a package named *registration* that includes two functions and one procedure.
* The *Info* button (i) is disabled for this dialog.
* Click the *Save* button to save work.
* Click the *Cancel* button to exit without saving work.
* Click the *Reset* button to restore configuration parameters.