Contents
- Getting Started
- External database for pgAdmin user settings
- Connecting To A Server
- Managing Cluster Objects
- Managing Database Objects
- Cast Dialog
- Collation Dialog
- Domain Dialog
- Domain Constraints Dialog
- Event Trigger Dialog
- Extension Dialog
- Foreign Data Wrapper Dialog
- Foreign Server Dialog
- Foreign Table Dialog
- FTS Configuration Dialog
- FTS Dictionary Dialog
- FTS Parser Dialog
- FTS Template Dialog
- Function Dialog
- Language Dialog
- Materialized View Dialog
- Package Dialog
- Procedure Dialog
- Publication Dialog
- Schema Dialog
- Sequence Dialog
- Subscription Dialog
- Synonym Dialog
- Trigger Function Dialog
- Type Dialog
- User Mapping Dialog
- View Dialog
- Creating or Modifying a Table
- Management Basics
- Backup and Restore
- Developer Tools
- Processes
- pgAgent
- pgAdmin Project Contributions
- Release Notes
- Licence
Package Dialog¶
Use the Package dialog to create a (user-defined) package specification.
The Package dialog organizes the management of a package through the following dialog tabs: General, Header, Body, and Security. The SQL tab displays the SQL code generated by dialog selections.
![Package dialog general tab](/https/www.pgadmin.org/static/docs/pgadmin4-7.8-docs/_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.
Select the schema in which the package will reside from the drop-down listbox in the Schema field.
Store notes about the package in the Comment field.
Click the Header tab to continue.
![Package dialog header tab](/https/www.pgadmin.org/static/docs/pgadmin4-7.8-docs/_images/package_header.png)
Use the Header field to define the public interface for the package.
Click the Body tab to continue.
![Package dialog body tab](/https/www.pgadmin.org/static/docs/pgadmin4-7.8-docs/_images/package_body.png)
Use the Body field to provide the code that implements each package object.
Click the Security tab to continue.
![Package dialog security tab](/https/www.pgadmin.org/static/docs/pgadmin4-7.8-docs/_images/package_security.png)
Use the fields in the Security tab to assign EXECUTE privileges for the package 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 a privilege 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.
Click the Add icon (+) to assign additional privileges; to discard a privilege, click the trash icon to the left of the row, and confirm the deletion in the Delete Row popup.
Click the SQL tab to continue.
Your entries in the Package dialog generate a SQL command that creates or modifies a package definition:
![Package dialog sql tab](/https/www.pgadmin.org/static/docs/pgadmin4-7.8-docs/_images/package_sql.png)
The example shown demonstrates creating a package named empinfo that includes two function and two procedure.
Click the Save button to save work.
Click the Close button to exit without saving work.
Click the Reset button to delete any changes to the dialog.