Pgadmin4-4 25
Pgadmin4-4 25
Release 4.25
1 Getting Started 3
1.1 Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2 Login Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.3 User Management Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
1.4 Change User Password Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
1.5 Enabling LDAP Authentication for pgAdmin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
1.6 User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
1.7 Menu Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
1.8 Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
1.9 Tabbed Browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
1.10 Tree Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
1.11 Preferences Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
1.12 Keyboard Shortcuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
1.13 Search objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
2 Connecting To A Server 67
2.1 Server Group Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
2.2 Server Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
2.3 Master Password . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
2.4 Connect to Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
2.5 Connection Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
2.6 Import/Export Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
i
4.7 Foreign Data Wrapper Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
4.8 Foreign Server Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
4.9 Foreign Table Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
4.10 FTS Configuration Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
4.11 FTS Dictionary Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
4.12 FTS Parser Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
4.13 FTS Template Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
4.14 Function Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
4.15 Language Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
4.16 Materialized View Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
4.17 Package Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
4.18 Procedure Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
4.19 Schema Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
4.20 Sequence Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
4.21 Synonym Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
4.22 Trigger Function Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
4.23 Type Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
4.24 User Mapping Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
4.25 View Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
9 pgAgent 313
9.1 Using pgAgent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
ii
9.2 Installing pgAgent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
9.3 Creating a pgAgent Job . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
iii
12 Licence 399
Index 401
iv
pgAdmin 4 Documentation, Release 4.25
Welcome to pgAdmin 4. pgAdmin is the leading Open Source management tool for Postgres, the world’s most
advanced Open Source database. pgAdmin 4 is designed to meet the needs of both novice and experienced Postgres
users alike, providing a powerful graphical interface that simplifies the creation, maintenance and use of database
objects.
Contents 1
pgAdmin 4 Documentation, Release 4.25
2 Contents
CHAPTER 1
Getting Started
Pre-compiled and configured installation packages for pgAdmin 4 are available for a number of desktop environments;
we recommend using an installer whenever possible.
In a Server Deployment, the pgAdmin application is deployed behind a webserver or with the WSGI interface. If
you install pgAdmin in server mode, you will be prompted to provide a role name and pgAdmin password when you
initially connect to pgAdmin. The first role registered with pgAdmin will be an administrative user; the administrative
role can use the pgAdmin User Management dialog to create and manage additional pgAdmin user accounts. When a
user authenticates with pgAdmin, the pgAdmin tree control displays the server definitions associated with that login
role.
In a Desktop Deployment, the pgAdmin application is configured to use the desktop runtime environment to host the
program on a supported platform. Typically, users will install a pre-built package to run pgAdmin in desktop mode, but
a manual desktop deployment can be installed and though it is more difficult to setup, it may be useful for developers
interested in understanding how pgAdmin works.
It is also possible to use a Container Deployment of pgAdmin, in which Server Mode is pre-configured for security.
3
pgAdmin 4 Documentation, Release 4.25
1.1 Deployment
Pre-compiled and configured installation packages for pgAdmin 4 are available for a number of desktop environments;
we recommend using an installer whenever possible. If you are interested in learning more about the project, or if
a pgAdmin installer is not available for your environment, the pages listed below will provide detailed information
about creating a custom deployment.
There are multiple configuration files that are read at startup by pgAdmin. These are as follows:
• config.py: This is the main configuration file, and should not be modified. It can be used as a reference for
configuration settings, that may be overridden in one of the following files.
• config_distro.py: This file is read after config.py and is intended for packagers to change any settings
that are required for their pgAdmin distribution. This may typically include certain paths and file locations. This
file is optional, and may be created by packagers in the same directory as config.py if needed.
• config_local.py: This file is read after config_distro.py and is intended for end users to change any
default or packaging specific settings that they may wish to adjust to meet local preferences or standards.This
file is optional, and may be created by users in the same directory as config.py if needed.
• config_system.py: This file is read after config_local.py and is intended for system administrators
to include settings that are configured system-wide from a secure location that users cannot normally modify
and that is outside of the pgAdmin installation. The location for this file varies based on the platform, and only
needs to be created if desired:
– Linux: /etc/pgadmin/config_system.py
– macOS: /Library/Preferences/pgadmin/config_system.py
– Windows: %CommonProgramFiles%\pgadmin\config_system.py
##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2020, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
# config.py - Core application configuration settings
#
##########################################################################
import builtins
import logging
import os
(continues on next page)
##########################################################################
# Application settings
##########################################################################
##########################################################################
# Application settings
##########################################################################
# NOTE!!!
# If you change any of APP_RELEASE, APP_REVISION or APP_SUFFIX, then you
# must also change APP_VERSION_INT to match.
#
# Any changes made here must also be made in runtime/pgAdmin4.pro and
# runtime/Info.plist
#
# DO NOT CHANGE!
# The application version string, constructed from the components
if not APP_SUFFIX:
APP_VERSION = '%s.%s' % (APP_RELEASE, APP_REVISION)
else:
APP_VERSION = '%s.%s-%s' % (APP_RELEASE, APP_REVISION, APP_SUFFIX)
##########################################################################
# Misc stuff
##########################################################################
(continues on next page)
1.1. Deployment 5
pgAdmin 4 Documentation, Release 4.25
##########################################################################
# Server settings
##########################################################################
# The server mode determines whether or not we're running on a web server
# requiring user authentication, or desktop mode which uses an automatic
# default login.
#
# DO NOT DISABLE SERVER MODE IF RUNNING ON A WEBSERVER!!
#
# We only set SERVER_MODE if it's not already set. That's to allow the
# runtime to force it to False.
#
# NOTE: If you change the value of SERVER_MODE in an included config file,
# you may also need to redefine any values below that are derived
# from it, notably various paths such as LOG_FILE and anything
# using DATA_DIR.
# HTTP headers to search for CSRF token when it is not provided in the form.
# Default is ['X-CSRFToken', 'X-CSRF-Token']
WTF_CSRF_HEADERS = ['X-pgA-CSRFToken']
# User ID (email address) to use for the default user in desktop mode.
# The default should be fine here, as it's not exposed in the app.
DESKTOP_USER = '[email protected]'
(continues on next page)
# The default port on which the app server will listen if not set in the
# environment by the runtime
DEFAULT_SERVER_PORT = 5050
# COMPRESSION
COMPRESS_MIMETYPES = [
'text/html', 'text/css', 'text/xml', 'application/json',
'application/javascript'
]
COMPRESS_LEVEL = 9
COMPRESS_MIN_SIZE = 500
1.1. Deployment 7
pgAdmin 4 Documentation, Release 4.25
# Data directory for storage of config settings etc. This shouldn't normally
# need to be changed - it's here as various other settings depend on it.
# On Windows, we always store data in %APPDATA%\pgAdmin. On other platforms,
# if we're in server mode we use /var/lib/pgadmin, otherwise ~/.pgadmin
if IS_WIN:
# Use the short path on windows
DATA_DIR = os.path.realpath(
os.path.join(fs_short_path(env('APPDATA')), u"pgAdmin")
)
else:
if SERVER_MODE:
DATA_DIR = '/var/lib/pgadmin'
else:
DATA_DIR = os.path.realpath(os.path.expanduser(u'~/.pgadmin/'))
##########################################################################
# Log settings
##########################################################################
# Debug mode?
DEBUG = False
# Log format.
CONSOLE_LOG_FORMAT = '%(asctime)s: %(levelname)s\t%(name)s:\t%(message)s'
FILE_LOG_FORMAT = '%(asctime)s: %(levelname)s\t%(name)s:\t%(message)s'
# Log file name. This goes in the data directory, except on non-Windows
(continues on next page)
##########################################################################
# Server Connection Driver Settings
##########################################################################
# Maximum allowed idle time in minutes before which releasing the connection
# for the particular session. (in minutes)
MAX_SESSION_IDLE_TIME = 60
##########################################################################
# User account and settings storage
##########################################################################
# The default path to the SQLite database used to store user accounts and
# settings. This default places the file in the same directory as this
# config file, but generates an absolute path for use througout the app.
SQLITE_PATH = env('SQLITE_PATH') or os.path.join(DATA_DIR, 'pgadmin4.db')
# SQLITE_TIMEOUT will define how long to wait before throwing the error -
# OperationError due to database lock. On slower system, you may need to change
# this to some higher value.
# (Default: 500 milliseconds)
SQLITE_TIMEOUT = 500
##########################################################################
# Server-side session storage path
#
# SESSION_DB_PATH (Default: $HOME/.pgadmin4/sessions)
##########################################################################
#
# We use SQLite for server-side session storage. There will be one
# SQLite database object per session created.
#
# Specify the path used to store your session objects.
#
# If the specified directory does not exist, the setup script will create
# it with permission mode 700 to keep the session database secure.
#
# On certain systems, you can use shared memory (tmpfs) for maximum
# scalability, for example, on Ubuntu:
#
# SESSION_DB_PATH = '/run/shm/pgAdmin4_session'
(continues on next page)
1.1. Deployment 9
pgAdmin 4 Documentation, Release 4.25
SESSION_COOKIE_NAME = 'pga4_session'
##########################################################################
# Mail server settings
##########################################################################
# These settings are used when running in web server mode for confirming
# and resetting passwords etc.
# See: http://pythonhosted.org/Flask-Mail/ for more info
MAIL_SERVER = 'localhost'
MAIL_PORT = 25
MAIL_USE_SSL = False
MAIL_USE_TLS = False
MAIL_USERNAME = ''
MAIL_PASSWORD = ''
MAIL_DEBUG = False
##########################################################################
# Mail content settings
##########################################################################
##########################################################################
# Upgrade checks
##########################################################################
##########################################################################
# Storage Manager storage url config settings
# If user sets STORAGE_DIR to empty it will show all volumes if platform
# is Windows, '/' if it is Linux, Mac or any other unix type system.
# For example:
# 1. STORAGE_DIR = get_drive("C") or get_drive() # return C:/ by default
# where C can be any drive character such as "D", "E", "G" etc
# 2. Set path manually like
# STORAGE_DIR = "/path/to/directory/"
##########################################################################
STORAGE_DIR = os.path.join(DATA_DIR, 'storage')
##########################################################################
# Default locations for binary utilities (pg_dump, pg_restore etc)
#
# These are intentionally left empty in the main config file, but are
# expected to be overridden by packagers in config_distro.py.
#
# A default location can be specified for each database driver ID, in
# a dictionary. Either an absolute or relative path can be specified.
# In cases where it may be difficult to know what the working directory
# is, "$DIR" can be specified. This will be replaced with the path to the
# top-level pgAdmin4.py file. For example, on macOS we might use:
#
# $DIR/../../SharedSupport
#
##########################################################################
DEFAULT_BINARY_PATHS = {
"pg": "",
"ppas": "",
"gpdb": ""
}
##########################################################################
# Test settings - used primarily by the regression suite, not for users
##########################################################################
##########################################################################
# Allows flask application to response to the each request asynchronously
##########################################################################
THREADED_MODE = True
##########################################################################
# Do not allow SQLALCHEMY to track modification as it is going to be
# deprecated in future
##########################################################################
SQLALCHEMY_TRACK_MODIFICATIONS = False
##########################################################################
# Number of records to fetch in one batch in query tool when query result
# set is large.
##########################################################################
(continues on next page)
1.1. Deployment 11
pgAdmin 4 Documentation, Release 4.25
##########################################################################
# Allow users to display Gravatar image for their username in Server mode
##########################################################################
SHOW_GRAVATAR_IMAGE = True
##########################################################################
# Set cookie path
##########################################################################
COOKIE_DEFAULT_PATH = '/'
COOKIE_DEFAULT_DOMAIN = None
SESSION_COOKIE_DOMAIN = None
SESSION_COOKIE_SAMESITE = 'Lax'
#########################################################################
# Skip storing session in files and cache for specific paths
#########################################################################
SESSION_SKIP_PATHS = [
'/misc/ping'
]
##########################################################################
# Session expiration support
##########################################################################
# SESSION_EXPIRATION_TIME is the interval in Days. Session will be
# expire after the specified number of *days*.
SESSION_EXPIRATION_TIME = 1
##########################################################################
# SSH Tunneling supports only for Python 2.7 and 3.4+
##########################################################################
SUPPORT_SSH_TUNNEL = True
# Allow SSH Tunnel passwords to be saved if the user chooses.
# Set to False to disable password saving.
ALLOW_SAVE_TUNNEL_PASSWORD = False
##########################################################################
# Allows pgAdmin4 to create session cookies based on IP address, so even
# if a cookie is stolen, the attacker will not be able to connect to the
# server using that stolen cookie.
# Note: This can cause problems when the server is deployed in dynamic IP
# address hosting environments, such as Kubernetes or behind load
# balancers. In such cases, this option should be set to False.
##########################################################################
ENHANCED_COOKIE_PROTECTION = True
##########################################################################
# External Authentication Sources
##########################################################################
AUTHENTICATION_SOURCES = ['internal']
##########################################################################
# LDAP Configuration
##########################################################################
# After ldap authentication, user will be added into the SQLite database
# automatically, if set to True.
# Set it to False, if user should not be added automatically,
# in this case Admin has to add the user manually in the SQLite database.
LDAP_AUTO_CREATE_USER = True
# Connection timeout
LDAP_CONNECTION_TIMEOUT = 10
# The LDAP attribute containing user names. In OpenLDAP, this may be 'uid'
# whilst in AD, 'sAMAccountName' might be appropriate. (REQUIRED)
LDAP_USERNAME_ATTRIBUTE = '<User-id>'
##########################################################################
# 3 ways to configure LDAP as follows (Choose anyone):
1.1. Deployment 13
pgAdmin 4 Documentation, Release 4.25
# OR ####################
# 2. Anonymous Binding
LDAP_ANONYMOUS_BIND = False
# OR ####################
# 3. Bind as pgAdmin user
# BaseDN (REQUIRED)
# AD example:
# (&(objectClass=user)(memberof=CN=MYGROUP,CN=Users,dc=example,dc=com))
# OpenLDAP example: CN=Users,dc=example,dc=com
LDAP_BASE_DN = '<Base-DN>'
##########################################################################
##########################################################################
# Local config settings
##########################################################################
# Load system config overrides. We do this last, so that the sysadmin can
# override anything they want from a config file that's in a protected system
# directory and away from pgAdmin to avoid invalidating signatures.
system_config_dir = '/etc/pgadmin'
if sys.platform.startswith('win32'):
system_config_dir = os.environ['CommonProgramFiles'] + '/pgadmin'
elif sys.platform.startswith('darwin'):
system_config_dir = '/Library/Preferences/pgadmin'
if os.path.exists(system_config_dir + '/config_system.py'):
try:
sys.path.insert(0, system_config_dir)
from config_system import *
except ImportError:
pass
pgAdmin may be deployed as a desktop application by configuring the application to run in desktop mode and then
utilising the desktop runtime to host the program on a supported Windows, Mac OS X or Linux installation.
The desktop runtime is a system-tray application that when launched, runs the pgAdmin server and launches a web
browser to render the user interface. If additional instances of pgAdmin are launched, a new browser tab will be opened
and be served by the existing instance of the server in order to minimise system resource utilisation. Clicking the icon
in the system tray will present a menu offering options to open a new pgAdmin window, configure the runtime, view
the server log and shut down the server.
Note: Pre-compiled and configured installation packages are available for a number of platforms. These packages
should be used by end-users whereever possible - the following information is useful for the maintainers of those
packages and users interested in understanding how pgAdmin works.
See also:
For detailed instructions on building and configuring pgAdmin from scratch, please see the README file in the top
level directory of the source code. For convenience, you can find the latest version of the file here, but be aware that
this may differ from the version included with the source code for a specific version of pgAdmin.
1.1. Deployment 15
pgAdmin 4 Documentation, Release 4.25
Configuration
From pgAdmin 4 v2 onwards, the default configuration mode is server, however, this is overridden by the desktop
runtime at startup. In most environments, no Python configuration is required unless you wish to override other
default settings.
See The config.py File for more information on configuration settings.
Runtime
When executed, the runtime will automatically try to execute the pgAdmin Python application. If execution fails,
it will prompt you to adjust the Python Path to include the directories containing the pgAdmin code as well as any
additional Python dependencies. You can enter a list of paths by separating them with a semi-colon character, for
example:
/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/;/Users/dpage/python-
˓→libs/
The configuration settings are stored using the QSettings class in Qt, which will use an INI file on Unix systems
(~/.config/pgadmin/pgadmin4.conf), a plist file on Mac OS X (~/Library/Preferences/org.pgadmin.pgadmin4.plist),
and the registry on Windows (HKEY_CURRENT_USER\Software\pgadmin\pgadmin4).
The configuration settings:
pgAdmin may be deployed as a web application by configuring the app to run in server mode and then deploying it
either behind a webserver running as a reverse proxy, or using the WSGI interface.
When deployed in server mode, there are two notable differences for users:
• Users must login before they can use pgAdmin. An initial superuser account is created when server mode is
initialised, and this user can add additional superusers and non-superusers as required.
• File storage is restricted to a virtual root directory for each individual user under the directory configured using
the STORAGE_DIR configuration parameter. Users do not have access to the complete filesystem of the server.
The following instructions demonstrate how pgAdmin may be run as a WSGI application under Apache HTTPD,
using mod_wsgi, standalone using uWSGI or Gunicorn, or under NGINX using using uWSGI or Gunicorn.
See also:
For detailed instructions on building and configuring pgAdmin from scratch, please see the README file in the top
level directory of the source code. For convenience, you can find the latest version of the file here, but be aware that
this may differ from the version included with the source code for a specific version of pgAdmin.
Requirements
Important: Some components of pgAdmin require the ability to maintain affinity between client sessions and a
specific database connection (for example, the Query Tool in which the user might run a BEGIN command followed
by a number of DML SQL statements, and then a COMMIT). pgAdmin has been designed with built-in connection
management to handle this, however it requires that only a single Python process is used because it is not easily
possible to maintain affinity between a client session and one of multiple WSGI worker processes.
On Windows systems, the Apache HTTP server uses a single process, multi-threaded architecture. WSGI applications
run in embedded mode, which means that only a single process will be present on this platform in all cases.
On Unix systems, the Apache HTTP server typically uses a multi-process, single threaded architecture (this is depen-
dent on the MPM that is chosen at compile time). If embedded mode is chosen for the WSGI application, then there
will be one Python environment for each Apache process, each with it’s own connection manager which will lead to
loss of connection affinity. Therefore one should use mod_wsgi’s daemon mode, configured to use a single process.
This will launch a single instance of the WSGI application which is utilised by all the Apache worker processes.
Whilst it is true that this is a potential performance bottleneck, in reality pgAdmin is not a web application that’s ever
likely to see heavy traffic unlike a busy website, so in practice should not be an issue.
Future versions of pgAdmin may introduce a shared connection manager process to overcome this limitation, however
that is a significant amount of work for little practical gain.
Configuration
In order to configure pgAdmin to run in server mode, it may be necessary to configure the Python code to run in
multi-user mode, and then to configure the web server to find and execute the code.
See The config.py File for more information on configuration settings.
Python
From pgAdmin 4 v2 onwards, server mode is the default configuration. If running under the desktop runtime, this is
overridden automatically. There should typically be no need to modify the configuration simply to enable server mode
to work, however it may be desirable to adjust some of the paths used.
In order to configure the Python code, follow these steps:
1. Create a config_local.py file alongside the existing config.py file.
2. Edit config_local.py and add the following settings. In most cases, the default file locations should be
appropriate:
NOTE: You must ensure the directories specified are writeable by the user that the web server processes will be
running as, e.g. apache or www-data.
LOG_FILE = '/var/log/pgadmin4/pgadmin4.log'
SQLITE_PATH = '/var/lib/pgadmin4/pgadmin4.db'
SESSION_DB_PATH = '/var/lib/pgadmin4/sessions'
STORAGE_DIR = '/var/lib/pgadmin4/storage'
5. Change the ownership of the configuration database to the user that the web server processes will run as, for
example, assuming that the web server runs as user www-data in group www-data, and that the SQLite path is
/var/lib/pgadmin4/pgadmin4.db:
1.1. Deployment 17
pgAdmin 4 Documentation, Release 4.25
Hosting
There are many possible ways to host pgAdmin in server mode. Some examples are given below:
Once Apache HTTP has been configured to support mod_wsgi, the pgAdmin application may be configured similarly
to the example below:
<VirtualHost *>
ServerName pgadmin.example.com
WSGIScriptAlias / "C:\Program Files\pgAdmin4\web\pgAdmin4.wsgi"
<Directory "C:\Program Files\pgAdmin4\web">
Order deny,allow
Allow from all
</Directory>
</VirtualHost>
Now open the file C:\Program Files\pgAdmin4\web\pgAdmin4.wsgi with your favorite editor and add
the code below which will activate Python virtual environment when Apache server runs.
Note: The changes made in pgAdmin4.wsgi file will revert when pgAdmin4 is either upgraded or downgraded.
Once Apache HTTP has been configured to support mod_wsgi, the pgAdmin application may be configured similarly
to the example below:
<VirtualHost *>
ServerName pgadmin.example.com
<Directory /opt/pgAdmin4/web>
WSGIProcessGroup pgadmin
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
</Directory>
</VirtualHost>
Note: If you’re using Apache HTTPD 2.4 or later, replace the lines:
Order deny,allow
Allow from all
with:
pgAdmin may be hosted by Gunicorn directly simply by running a command such as the one shown below. Note that
this example assumes pgAdmin was installed using the Python Wheel (you may need to adjust the path to suit your
installation):
pgAdmin may be hosted by uWSGI directly simply by running a command such as the one shown below. Note that
this example assumes pgAdmin was installed using the Python Wheel (you may need to adjust the path to suit your
installation):
pgAdmin can be hosted by Gunicorn, with NGINX in front of it. Note that these examples assume pgAdmin was
installed using the Python Wheel (you may need to adjust the path to suit your installation).
To run with pgAdmin in the root directory of the server, start Gunicorn using a command similar to:
location / {
include proxy_params;
proxy_pass http://unix:/tmp/pgadmin4.sock;
}
Alternatively, pgAdmin can be hosted in a sub-directory (/pgadmin4 in this case) on the server. Start Gunicorn as
when using the root directory, but configure NGINX as follows:
1.1. Deployment 19
pgAdmin 4 Documentation, Release 4.25
location /pgadmin4/ {
include proxy_params;
proxy_pass http://unix:/tmp/pgadmin4.sock;
proxy_set_header X-Script-Name /pgadmin4;
}
pgAdmin can be hosted by uWSGI, with NGINX in front of it. Note that these examples assume pgAdmin was
installed using the Python Wheel (you may need to adjust the path to suit your installation).
To run with pgAdmin in the root directory of the server, start Gunicorn using a command similar to:
Alternatively, pgAdmin can be hosted in a sub-directory (/pgadmin4 in this case) on the server. Start uWSGI, noting
that the directory name is specified in the mount parameter:
PostgreSQL Utilities
The PostgreSQL utilities pg_dump, pg_dumpall, pg_restore and psql are included in the container to allow backups
to be created and restored and other maintenance functions to be executed. Multiple versions are included in the
following directories to allow use with different versions of the database server:
• PostgreSQL 9.5: /usr/local/pgsql-9.5
• PostgreSQL 9.6: /usr/local/pgsql-9.6
• PostgreSQL 10: /usr/local/pgsql-10
• PostgreSQL 11: /usr/local/pgsql-11
• PostgreSQL 12: /usr/local/pgsql-12
The most recent version of the utilities is used by default; this may be changed in the Preferences Dialog.
Environment Variables
1.1. Deployment 21
pgAdmin 4 Documentation, Release 4.25
Override the default file path for the server definition list. See the /pgadmin4/servers.json mapped file below for more
information.
GUNICORN_ACCESS_LOGFILE
Default: - (stdout)
Specify an output file in which to store the Gunicorn access logs, instead of sending them to stdout.
GUNICORN_THREADS
Default: 25
Adjust the number of threads the Gunicorn server uses to handle incoming requests. This should typically be left as-is,
except in highly loaded systems where it may be increased.
PGADMIN_CONFIG_
This is a variable prefix that can be used to override any of the configuration options in pgAdmin’s config.py file. Add
the PGADMIN_CONFIG_ prefix to any variable name from config.py and give the value in the format ‘string value’
for strings, True/False for booleans or 123 for numbers. See below for an example.
Settings are written to /pgadmin4/config_distro.py within the container, which is read after /pgadmin4/config.py and
before /pgadmin4/config_local.py. Any settings given will therefore override anything in config.py, but can be over-
ridden by settings in config_local.py.
See The config.py File for more information on the available configuration settings.
The following files or directories can be mapped from the container onto the host machine to allow configuration to
be customised and shared between instances.
Warning: Warning: pgAdmin runs as the pgadmin user (UID: 5050) in the pgadmin group (GID: 5050) in the
container. You must ensure that all files are readable, and where necessary (e.g. the working/session directory)
writeable for this user on the host machine. For example:
sudo chown -R 5050:5050 <host_directory>
On some filesystems that do not support extended attributes, it may not be possible to run pgAdmin without
specifying a value for PGADMIN_LISTEN_PORT that is greater than 1024. In such cases, specify an alternate
port when launching the container by adding the environment variable, for example:
-e 'PGADMIN_LISTEN_PORT=5050'
/var/lib/pgadmin
This is the working directory in which pgAdmin stores session data, user files, configuration files, and it’s configuration
database. Mapping this directory onto the host machine gives you an easy way to maintain configuration between
invocations of the container.
/pgadmin4/config_local.py
This file can be used to override configuration settings in pgAdmin. Settings found in config.py can be overridden
with deployment specific values if required. Settings in config_local.py will also override anything specified in the
container environment through PGADMIN_CONFIG_ prefixed variables.
/pgadmin4/servers.json
If this file is mapped, server definitions found in it will be loaded at launch time. This allows connection information
to be pre-loaded into the instance of pgAdmin in the container. Note that server definitions are only loaded on first
launch, i.e. when the configuration database is created, and not on subsequent launches using the same configuration
database.
/certs/server.cert
If TLS is enabled, this file will be used as the servers TLS certificate.
/certs/server.key
If TLS is enabled, this file will be used as the key file for the servers TLS certificate.
Examples
Run a simple container over port 80, setting some configuration options:
Run a TLS secured container using a shared config/storage directory in /private/var/lib/pgadmin on the host, and
servers pre-loaded from /tmp/servers.json on the host:
1.1. Deployment 23
pgAdmin 4 Documentation, Release 4.25
Reverse Proxying
Sometimes it’s desirable to have users connect to pgAdmin through a reverse proxy rather than directly to the container
it’s running in. The following examples show how this can be achieved. With traditional reverse proxy servers such
as Nginx, pgAdmin is running in a container on the same host, with port 5050 on the host mapped to port 80 on the
container, for example:
pgAdmin needs to understand how many proxies set each header so it knows what values to trust. The configuration
parameters for the X-Forwarded-* options which are used for this purpose are shown below, along with their default
values.
pgAdmin is configured by default to be able to run behind a reverse proxy even on a non-standard port and these
config options don’t normally need to be changed. If you’re running an unusual configuration (such as multiple
reverse proxies) you can adjust the configuration to suit.
A configuration similar to the following can be used to create a simple HTTP reverse proxy listening for all hostnames
with Nginx:
server {
listen 80;
server_name _;
location / {
proxy_set_header Host $host;
proxy_pass http://localhost:5050/;
proxy_redirect off;
}
}
If you wish to host pgAdmin under a subdirectory rather than on the root of the server, you must specify the location
and set the X-Script-Name header which tells the pgAdmin container how to rewrite paths:
server {
listen 80;
server_name _;
location /pgadmin4/ {
proxy_set_header X-Script-Name /pgadmin4;
proxy_set_header Host $host;
proxy_pass http://localhost:5050/;
proxy_redirect off;
}
}
If Nginx is also running in a container, there is no need to map the pgAdmin port to the host, provided the two
containers are running in the same Docker network. In such a configuration, the proxy_pass option would be changed
to point to the pgAdmin container within the Docker network.
The following configuration can be used to serve pgAdmin over HTTPS to the user whilst the backend container is
serving plain HTTP to the proxy server. In this configuration we not only set X-Script-Name, but also X-Scheme to
tell the pgAdmin server to generate any URLs using the correct scheme. A redirect from HTTP to HTTPS is also
included. The certificate and key paths may need to be adjusted as appropriate to the specific deployment:
server {
listen 80;
return 301 https://$host$request_uri;
}
server {
listen 443;
server_name _;
ssl_certificate /etc/nginx/server.cert;
ssl_certificate_key /etc/nginx/server.key;
ssl on;
ssl_session_cache builtin:1000 shared:SSL:10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
ssl_prefer_server_ciphers on;
location /pgadmin4/ {
proxy_set_header X-Script-Name /pgadmin4;
proxy_set_header X-Scheme $scheme;
proxy_set_header Host $host;
proxy_pass http://localhost:5050/;
proxy_redirect off;
}
}
1.1. Deployment 25
pgAdmin 4 Documentation, Release 4.25
Traefik
Configuring Traefik is straightforward for either HTTP or HTTPS when running pgAdmin in a container as it will
automatically configure itself to serve content from containers that are running on the local machine, virtual hosting
them at <container_name>.<domain_name>, where the domain name is that specified in the Traefik configuration.
The container is typically launched per the example below:
Note that the TCP/IP port has not been mapped to the host as it was in the Nginx example, and the container name has
been set to a known value as it will be used as the hostname and may need to be added to the DNS zone file.
The following configuration will listen on ports 80 and 443, redirecting 80 to 443, using the default certificate shipped
with Traefik. See the Traefik documentation for options to use certificates from LetsEncrypt or other issuers.
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
[docker]
domain = "domain_name"
watch = true
If you wish to host pgAdmin under a subdirectory using Traefik, the configuration changes are typically made to the
way the container is launched and not to Traefik itself. For example, to host pgAdmin under /pgadmin4/ instead of at
the root directory, the Traefik configuration above may be used if the container is launched like this:
The SCRIPT_NAME environment variable has been set to tell the container it is being hosted under a subdirectory (in
the same way as the X-Script-Name header is used with Nginx), and a label has been added to tell Traefik to route
requests under the subdirectory to this container.
Use the fields in the Login dialog to authenticate your connection. There are two ways to authenticate your connection:
• From pgAdmin version 4.21 onwards, support for LDAP authentication has been added. If LDAP authentication
has been enabled for your pgAdmin application, you can use your LDAP credentials to log in to pgAdmin:
– Provide the LDAP username in the Email Address/Username field.
– Provide your LDAP password in the Password field.
• Alternatively, you can use the following information to log in to pgAdmin:
– Provide the email address associated with your account in the Email Address/Username field.
– Provide your password in the Password field.
Click the Login button to securely log into pgAdmin.
Please note that if the pgAdmin server is restarted, then you will be logged out. You need to re-login to continue.
If you cannot supply your password, click the Forgotten your password? button to launch a password recovery utility.
• Provide the email address associated with your account in the Email Address field.
• Click the Recover Password button to initiate recovery. An email, with directions on how to reset a password,
will be sent to the address entered in the Email Address field.
If you have forgotten the email associated with your account, please contact your administrator.
Please note that your LDAP password cannot be recovered using this dialog. If you enter your LDAP username in
the Email Address/Username field, and then enter your email to recover your password, an error message will be
displayed asking you to contact the LDAP administrator to recover your LDAP password.
When invoking pgAdmin in desktop mode, a password is randomly generated, and then ignored. If you install pgAd-
min in server mode, you will be prompted for an administrator email and password for the pgAdmin client.
When you authenticate with pgAdmin, the server definitions associated with that login role are made available in the
tree control. An administrative user can use the User Management dialog to:
• add or delete pgAdmin roles
• assign privileges
• manage the password associated with a role
Use the Search field to specify a criteria and review a list of users that matches with the specified criteria. You can
enter a value that matches the following criteria types: Authentication source, Username, or Email. For example, you
can enter ldap in the search box and only the records having ldap as authentication source will be displayed in the
User Management table.
To add a user, click the Add (+) button at the top right corner.
• Click in the Username field, and provide a username for the user. This field is enabled only if you select ldap
as authentication source. If you select internal as authentication source, your email address is displayed in the
username field.
• Click in the Email field, and provide an email address for the user.
• Use the drop-down list box next to Role to select whether a user is an Administrator or a User.
– Select Administrator if the user will have administrative privileges within the pgAdmin client.
– Select User to create a non-administrative user account.
• Move the Active switch to the No position if the account is not currently active; the default is Yes. Use this
switch to disable account activity without deleting an account.
• Use the New password field to provide the password associated with the user specified in the Email field. This
field is disabled if you select ldap as authentication source since LDAP password is not stored in the pgAdmin
database.
• Re-enter the password in the Confirm password field. This field is disabled if you select ldap as authentication
source.
To discard a user, and revoke access to pgAdmin, click the trash icon to the left of the row and confirm deletion in the
Delete user? dialog.
Users with the Administrator role are able to add, edit and remove pgAdmin users, but otherwise have the same
capabilities as those with the User role.
• Click the Help button (?) to access online help.
• Click the Close button to save work. You will be prompted to return to the dialog if your selections cannot be
saved.
It is a good policy to routinely change your password to protect data, even in what you may consider a ‘safe’ environ-
ment. In the workplace, failure to apply an appropriate password policy could leave you in breach of Data Protection
laws.
Please consider the following guidelines when selecting a password:
• Ensure that your password is an adequate length; 6 characters should be the absolute minimum number of
characters in the password.
• Ensure that your password is not open to dictionary attacks. Use a mixture of upper and lower case letters and
numerics, and avoid words or names. Consider using the first letter from each word in a phrase that you will
remember easily but is an unfamiliar acronym.
• Ensure that your password is changed regularly; at minimum, change it every ninety days.
The guidelines above should be considered a starting point: They are not a comprehensive list and they will not
guarantee security.
To enable LDAP authentication for pgAdmin, you must configure the LDAP settings in the config_local.py or con-
fig_system.py file (see the config.py documentation) on the system where pgAdmin is installed in Server mode. You
can copy these settings from config.py file and modify the values for the following parameters:
There are 3 ways to configure LDAP:
• Bind as pgAdmin user
• Anonymous bind
• Dedicated user bind
Parameter Description
AUTHENTICATION_SOURCES The default value for this parameter is internal. To enable LDAP
authentication, you must include ldap in the list of values for this
parameter. you can modify the value as follows:
• [‘ldap’]: pgAdmin will use only LDAP authentication.
• [‘ldap’, ‘internal’]: pgAdmin will first try to authenticate the
user through LDAP. If that authentication fails, then internal
user entries of pgAdmin will be used for authentication.
• [‘internal’, ‘ldap’]: pgAdmin will first try to authenticate the
user through internal user entries. If that authentication fails,
then LDAP authentication will be used.
Note: Pre-compiled and configured installation packages are available for a number of platforms. These packages
should be used by end-users whereever possible - the following information is useful for the maintainers of those
packages and users interested in understanding how pgAdmin works.
The pgAdmin 4 client features a highly-customizable display that features drag-and-drop panels that you can arrange
to make the best use of your desktop environment.
The tree control provides an elegant overview of the managed servers, and the objects that reside on each server. Right-
click on a node within the tree control to access context-sensitive menus that provide quick access to management tasks
for the selected object.
The tabbed browser provide quick access to statistical information about each object in the tree control, and pgAdmin
tools and utilities (such as the Query tool and the debugger). pgAdmin opens additional feature tabs each time you
access the extended functionality offered by pgAdmin tools; you can open, close, and re-arrange feature tabs as needed.
Use the Preferences dialog to customize the content and behaviour of the pgAdmin display. To open the Preferences
dialog, select Preferences from the File menu.
Help buttons in the lower-left corner of each dialog will open the online help for the dialog. You can access additional
Postgres help by navigating through the Help menu, and selecting the name of the resource that you wish to open.
You can search for objects in the database using the Search objects
pgAdmin 4 supports all PostgreSQL features, from writing simple SQL queries to developing complex databases. It
is designed to query an active database (in real-time), allowing you to stay current with modifications and implemen-
tations.
Features of pgAdmin 4 include:
• auto-detection and support for objects discovered at run-time
• a live SQL Query Tool with direct data editing
• support for administrative queries
• a syntax-highlighting SQL editor
• redesigned graphical interfaces
• powerful management dialogs and tools for common tasks
• responsive, context-sensitive behavior
• supportive error messages
• helpful hints
• online help and information about using pgAdmin dialogs and tools.
When pgAdmin opens, the interface features a menu bar and a window divided into two panes: the Browser tree
control in the left pane, and a tabbed browser in the right pane.
Select an icon from the Quick Links panel on the Dashboard tab to:
• Click the Add New Server button to open the Create - Server dialog to add a new server definition.
• Click the Configure pgAdmin button to open the Preferences dialog to customize your pgAdmin client.
Links in the Getting Started panel open a new browser tab that provide useful information for Postgres users:
• Click the PostgreSQL Documentation link to navigate to the Documentation page for the PostgreSQL open-
source project; once at the project site, you can review the manuals for the currently supported versions of the
PostgreSQL server.
• Click the pgAdmin Website link to navigate to the pgAdmin project website. The pgAdmin site features news
about recent pgAdmin releases and other project information.
• Click the Planet PostgreSQL link to navigate to the blog aggregator for Postgres related blogs.
• Click the Community Support link to navigate to the Community page at the PostgreSQL open-source project
site; this page provides information about obtaining support for PostgreSQL features.
The pgAdmin menu bar provides drop-down menus for access to options, commands, and utilities. The menu bar
displays the following selections: File, Object, Tools*, and Help. Selections may be grayed out which indicates they
are disabled for the object currently selected in the pgAdmin tree control.
Option Action
Prefer- Click to open the Preferences dialog to to customize your pgAdmin settings.
ences
Reset If you have modified the workspace, click to restore the default layout.
Layout
Lock Lay- Click to open a submenu to select the level for locking the UI layout This can also be changed from
out browser display preferences
The Object menu is context-sensitive. Use the Object menu to access the following options (in alphabetical order):
Option Action
Change Pass- Click to open the Change Password. . . dialog to change your password.
word. . .
Clear Saved If you have saved the database server password, click to clear the saved password. Enable only
Password when password is already saved.
Clear SSH Tun- If you have saved the ssh tunnel password, click to clear the saved password. Enable only when
nel Password password is already saved.
Connect Click to open the Connect to Server dialog to establish a connection with a server.
Server. . .
Create Click Create to access a context menu that provides context-sensitive selections. Your selection
opens a Create dialog for creating a new object.
Delete/Drop Click to delete the currently selected object from the server.
Disconnect Click to disconnect the currently selected server.
Server. . .
Drop Cascade Click to delete the currently selected object and all dependent objects from the server.
Properties. . . Click to review or modify the currently selected object’s properties.
Refresh. . . Click to refresh the currently selected object.
Remove Server Click to remove the currently selected server.
Scripts Click to open the Query tool to edit or view the selected script from the flyout menu.
Trigger(s) Click to Disable or Enable trigger(s) for the currently selected table. Options are displayed on
the flyout menu.
Truncate Click to remove all rows from a table (Truncate) or to remove all rows from a table and its child
tables (Truncate Cascade). Options are displayed on the flyout menu.
View Data Click to access a context menu that provides several options for viewing data (see below).
Use the Tools menu to access the following options (in alphabetical order):
Option Action
Add named restore Click to open the Add named restore point. . . dialog to take a point-in-time snapshot of the
point current server state.
Backup. . . Click to open the Backup. . . dialog to backup database objects.
Backup Globals. . . Click to open the Backup Globals. . . dialog to backup cluster objects.
Backup Server. . . Click to open the Backup Server. . . dialog to backup a server.
Grant Wizard. . . Click to access the Grant Wizard tool.
Import/Export. . . Click to open the Import/Export data. . . dialog to import or export data from a table.
Maintenance. . . Click to open the Maintenance. . . dialog to VACUUM, ANALYZE, REINDEX, or CLUS-
TER.
Pause replay of Click to pause the replay of the WAL log.
WAL
Query tool Click to open the Query tool for the currently selected object.
Reload Configura- Click to update configuration files without restarting the server.
tion. . .
Restore. . . Click to access the Restore dialog to restore database files from a backup.
Resume replay of Click to resume the replay of the WAL log.
WAL
Use the options on the Help menu to access online help documents, or to review information about the pgAdmin
installation (in alphabetical order):
Option Action
About Click to open a window where you will find information about pgAdmin; this includes the current
pgAdmin version and the current user.
4
Online Click to open documentation support for using pgAdmin utilities, tools and dialogs. Navigate (in the
Help newly opened tab?) help documents in the left browser pane or use the search bar to specify a topic.
pgAdmin Click to open the pgAdmin.org website in a browser window.
Website
Post- Click to access the PostgreSQL core documentation hosted at the PostgreSQL site. The site also offers
greSQL guides, tutorials, and resources.
Website
1.8 Toolbar
The pgAdmin toolbar provides shortcut buttons for frequently used features like View Data and the Query Tool which
are most frequently used in pgAdmin. This toolbar is visible on the Browser panel. Buttons get enabled/disabled based
on the selected browser node.
• Use the Query Tool button to open the Query Tool in the current database context.
• Use the View Data button to view/edit the data stored in a selected table.
• Use the Filtered Rows button to access the Data Filter popup to apply a filter to a set of data for viewing/editing.
• Use the Search objects button to access the search objects dialog. It helps you search any database object.
1.8. Toolbar 37
pgAdmin 4 Documentation, Release 4.25
The right pane of the pgAdmin window features a collection of tabs that display information about the object currently
selected in the pgAdmin tree control in the left window. Select a tab to access information about the highlighted object
in the tree control.
The graphs on the Dashboard tab provides an active analysis of the usage statistics for the selected server or database:
• The Server sessions or Database sessions graph displays the interactions with the server or database.
• The Transactions per second graph displays the commits, rollbacks, and total transactions per second that are
taking place on the server or database.
• The Tuples in graph displays the number of tuples inserted, updated, and deleted on the server or database.
• The Tuples out graph displays the number of tuples fetched and returned from the server or database.
• The Block I/O graph displays the number of blocks read from the filesystem or fetched from the buffer cache
(but not the operating system’s file system cache) for the server or database.
The Server activity panel displays information about sessions, locks, prepared transactions, and server configuration
(if applicable). The information is presented in context-sensitive tables. Use controls located above the table to:
• Click the Refresh button to update the information displayed in each table.
• Enter a value in the Search box to restrict the table content to one or more sessions that satisfy the search criteria.
For example, you can enter a process ID to locate a specific session, or a session state (such as idle) to locate all
of the sessions that are in an idle state.
You can use icons in the Sessions table to review or control the state of a session:
• Use the Terminate icon (located in the first column) to stop a session and remove the session from the table.
Before the server terminates the session, you will be prompted to confirm your selection.
• Use the Cancel icon (located in the second column) to terminate an active query without closing the session.
Before canceling the query, the server will prompt you to confirm your selection. When you cancel a query, the
value displayed in the State column of the table will be updated from Active to Idle. The session will remain in
the table until the session is terminated.
• Use the Details icon (located in the third column) to open the Details tab; the tab displays information about the
selected session.
Click the Edit icon in the toolbar under the browser tabs to launch the Properties dialog for the selected object.
To preserve any changes to the Properties dialog, click the Save icon; your modifications will be displayed in the
updated Properties tab.
Details about the object highlighted in the tree control are displayed in one or more collapsible panels. You can use
the arrow to the left of each panel label to open or close a panel.
The SQL tab displays the SQL script that created the highlighted object, and when applicable, a (commented out) SQL
statement that will DROP the selected object. You can copy the SQL statements to the editor of your choice using cut
and paste shortcuts.
The Statistics tab displays the statistics gathered for each object on the tree control; the statistics displayed in the table
vary by the type of object that is selected. Click a column heading to sort the table by the data displayed in the column;
click again to reverse the sort order. The following table lists some of the statistics that are available:
Panel Description
PID The process ID associated with the row.
User The name of the user that owns the object.
Database displays the database name.
Backends displays the number of current connections to the database.
Backend start The start time of the backend process.
Xact Committed displays the number of transactions committed to the database within the last week.
Xact Rolled Back displays the number of transactions rolled back within the last week.
Blocks Read displays the number of blocks read from memory (in megabytes) within the last week.
Blocks Hit displays the number of blocks hit in the cache (in megabytes) within the last week.
Tuples Returned displays the number of tuples returned within the last week.
Tuples Fetched displays the number of tuples fetched within the last week.
Tuples Inserted displays the number of tuples inserted into the database within the last week.
Tuples Updated displays the number of tuples updated in the database within the last week.
continues on next page
The Dependencies tab displays the objects on which the currently selected object depends. If a dependency is dropped,
the object currently selected in the pgAdmin tree control will be affected. To ensure the integrity of the entire database
structure, the database server makes sure that you do not accidentally drop objects that other objects depend on; you
must use the DROP CASCADE command to remove an object with a dependency.
The Dependencies table displays the following information:
• The Type field specifies the parent object type.
• The Name field specifies the identifying name of the parent object.
• The Restriction field describes the dependency relationship between the currently selected object and the parent:
– If the field is auto, the selected object can be dropped separately from the parent object, and will be dropped
if the parent object is dropped.
– If the field is internal, the selected object was created during the creation of the parent object, and will be
dropped if the parent object is dropped.
– If the field is normal, the selected object can be dropped without dropping the parent object.
– If the field is blank, the selected object is required by the system, and cannot be dropped.
The Dependents tab displays a table of objects that depend on the object currently selected in the pgAdmin browser. A
dependent object can be dropped without affecting the object currently selected in the pgAdmin tree control.
• The Type field specifies the dependent object type.
• The Name field specifies the identifying name for the dependent object.
• The Database field specifies the database in which the object resides.
Additional tabs open when you access the extended functionality offered by pgAdmin tools (such as the Query tool,
Debugger, or SQL editor). Use the close icon (X) located in the upper-right corner of each tab to close the tab when
you are finished using the tool. Like permanent tabs, these tabs may be repositioned in the pgAdmin client window.
By default, each time you open a tool, pgAdmin will open a new browser tab. You can control this behavior by
modifying the Display node of the Preferences dialog for each tool. To open the Preferences dialog, select Preferences
from the File menu.
The left pane of the main window displays a tree control (the pgAdmin tree control) that provides access to the objects
that reside on a server.
You can expand nodes in the tree control to view the database objects that reside on a selected server. The tree control
expands to display a hierarchical view:
• Use the plus sign (+) to the left of a node to expand a segment of the tree control.
• Click the minus sign (-) to the left of a node to close that node.
You can also drag and drop certain objects to the Query Tool which can save time in typing long object names. Text
containing the object name will be fully qualified with schema. Double quotes will be added if required. For functions
and procedures, the function name along with parameter names will be pasted in the Query Tool.
Access context-sensitive menus by right-clicking on a node of the tree control to perform common tasks. Menus
display options that include one or more of the following selections (options appear in alphabetical order):
Option Action
Add named re- Click to create and enter the name of a restore point.
store point
Backup. . . Click to open the Backup. . . dialog to backup database objects.
Backup Glob- Click to open the Backup Globals. . . dialog to backup cluster objects.
als. . .
Backup Click to open the Backup Server. . . dialog to backup a server.
Server. . .
Connect Click to open the Connect to Server dialog to establish a connection with a server.
Server. . .
Create Click to access a context menu that provides context-sensitive selections. Your selection opens
a Create dialog for creating a new object.
CREATE Script Click to open the Query tool to edit or view the CREATE script.
Debugging Click through to open the Debug tool or to select Set breakpoint to stop or pause a script
execution.
Delete/Drop Click to delete the currently selected object from the server.
Disconnect Click to terminate a database connection.
Database. . .
Disconnect Click to refresh the currently selected object.
Server. . .
Drop Cascade Click to delete the currently selected object and all dependent objects from the server.
Debugging Click to access the Debugger tool.
Grant Wizard Click to access the Grant Wizard tool.
Maintenance. . . Click to open the Maintenance. . . dialog to VACUUM, ANALYZE, REINDEX, or CLUSTER.
Properties. . . Click to review or modify the currently selected object’s properties.
Refresh. . . Click to refresh the currently selected object.
Reload Configu- Click to update configuration files without restarting the server.
ration. . .
Restore. . . Click to access the Restore dialog to restore database files from a backup.
View Data Use the View Data option to access the data stored in a selected table with the Data Output tab
of the Query Tool.
The context-sensitive menus associated with Tables and nested Table nodes provides additional display options (op-
tions appear in alphabetical order):
Option Action
Import/Export. . . Click open the Import/Export. . . dialog to import data to or export data from the selected
table.
Reset Statistics Click to reset statistics for the selected table.
Scripts Click to open the Query tool to edit or view the selected script from the flyout menu.
Truncate Click to remove all rows from a table.
Truncate Cascade Click to remove all rows from a table and its child tables.
View First 100 Rows Click to access a data grid that displays the first 100 rows of the selected table.
View Last 100 Rows Click to access a data grid that displays the last 100 rows of the selected table.
View All Rows Click to access a a data grid that displays all rows of the selected table.
View Filtered Click to access the Data Filter popup to apply a filter to a set of data.
Rows. . .
Use options on the Preferences dialog to customize the behavior of the client. To open the Preferences dialog, select
Preferences from the File menu. The left pane of the Preferences dialog displays a tree control; each node of the tree
control provides access to options that are related to the node under which they are displayed.
• Use the plus sign (+) to the left of a node name to expand a segment of the tree control.
• Use the minus sign (-) to the left of a node name to close that node.
Use preferences found in the Browser node of the tree control to personalize your workspace.
Use the fields on the Display panel to specify general display preferences:
• When the Auto-expand sole children switch is set to True, child nodes will be automatically expanded if a
treeview node is expanded and has only a single child.
• Use the Browser tree state saving interval field to set the treeview state saving interval. A value of -1 will disable
the treeview state saving functionality.
• When the Confirm before closing properties with unsaved changes switch is set to True, pgAdmin will warn you
before closing the properties dialog of an object if there are any unsaved changes. On user confirmation, the
properties dialog will close.
• When the Confirm on close or refresh switch is set to True, pgAdmin will attempt to catch browser close or
refresh events and prompt before allowing them to continue.
• When the Enable browser tree animation? switch is set to True, the client will display the animated tree control
otherwise it will be unanimated.
• When the Enable dialogue/notification animation? switch is set to True, the client will display the animated
dialogues/notifications otherwise it will be unanimated.
• Use the Lock layout field to lock the UI layout at different levels. This can also be changed from File menu on
the menu bar
Option Action
None No locking. Every panel is resizable and dockable.
Prevent docking This will disable the docking/undocking of the panels
Full This will disable resizing, docking/undocking of the panels
• When the Show system objects? switch is set to True, the client will display system objects such as system
schemas (for example, pg_temp) or system columns (for example, xmin or ctid) in the tree control.
Use the fields on the Keyboard shortcuts panel to configure shortcuts for the main window navigation:
• The panel displays a list of keyboard shortcuts available for the main window; select the combination of the
modifier keys along with the key to configure each shortcut.
Use the fields on the Nodes panel to select the object types that will be displayed in the Browser tree control:
• The panel displays a list of database objects; slide the switch located next to each object to Show or Hide
the database object. When querying system catalogs, you can reduce the number of object types displayed to
increase speed.
Use fields on the Properties panel to specify browser properties:
• Include a value in the Count rows if estimated less than field to perform a SELECT count(*) if the estimated
number of rows in a table (as read from the table statistics) is below the specified limit. After performing the
SELECT count(*), pgAdmin will display the row count. The default is 2000.
• Provide a value in the Maximum job history rows field to limit the number of rows to show on the statistics tab
for pgAgent jobs. The default is 250.
Use the fields on the Graphs panel to specify your display preferences for the graphs on the Dashboard tab:
• Use the Block I/O statistics refresh rate field to specify the number of seconds between block I/O statistic
samples displayed in graphs.
• Use the Session statistics refresh rate field to specify the number of seconds between session statistic samples
displayed in graphs.
• Use the Transaction throughput refresh rate field to specify the number of seconds between transaction through-
put samples displayed in graphs.
• Use the Tuples in refresh rate field to specify the number of seconds between tuples-in samples displayed in
graphs.
• Use the Tuples out refresh rate field to specify the number of seconds between tuples-out samples displayed in
graphs.
• When the Show activity? switch is set to True, activity tables will be displayed on dashboards.
• When the Show graph data points? switch is set to True, data points will be visible on graph lines.
• When the Show graphs? switch is set to True, graphs will be displayed on dashboards.
• When the Show mouse hover tooltip? switch is set to True, a tooltip will appear on mouse hover on the graph
lines giving the data point details.
• When the Open in new browser tab switch is set to True, the Debugger will open in a new browser tab when
invoked.
Use the fields on the Keyboard shortcuts panel to configure shortcuts for the debugger window navigation:
• Use the User language drop-down listbox to select the display language for the client.
• Use the Themes drop-down listbox to select the theme for pgAdmin. You’ll also get a preview just below the
drop down. Note that, to apply the theme you need to refresh the pgAdmin page. You can also submit your own
themes, check here how. Currently we support Standard, Dark and High Contrast (Beta) theme.
Expand the Paths node to specify the locations of supporting utility and help files.
Use the fields on the Binary paths panel to specify the path to the directory that contains the utility programs (pg_dump,
pg_restore, and pg_dumpall) for monitored databases:
• Use the EDB Advanced Server Binary Path field to specify the location of the EDB Postgres Advanced Server
utility programs. If this path is not set, pgAdmin will attempt to find the utilities in standard locations used by
EnterpriseDB.
• Use the Greenplum Database Binary Path field to specify the location of the Greenplum database utility pro-
grams. If this path is not set, pgAdmin will attempt to find the utilities in standard locations used by Greenplum.
• Use the PostgreSQL Binary Path field to specify the location of the PostgreSQL utility programs. If this
path is not set, pgAdmin will attempt to find the utilities in standard locations used by PostgreSQL.
Use the fields on the Help panel to specify the location of help files.
• Use the EDB Advanced Server Help Path to specify the path to EDB Postgres Advanced Server documentation.
• Use the PostgreSQL Help Path to specify the path to PostgreSQL documentation.
Please note: the default help paths include the VERSION placeholder; the $VERSION$ placeholder will be replaced
by the current database version.
Expand the Query Tool node to access panels that allow you to specify your preferences for the Query Editor tool.
Use the fields on the Auto Completion panel to set the auto completion options.
• When the Keywords in uppercase switch is set to True then keywords are shown in upper case.
Use the fields on the CSV/TXT Output panel to control the CSV/TXT output.
• Use the CSV field separator drop-down listbox to specify the separator character that will be used in CSV/TXT
output.
• Use the CSV quote character drop-down listbox to specify the quote character that will be used in CSV/TXT
output.
• Use the CSV quoting drop-down listbox to select the fields that will be quoted in the CSV/TXT output; select
Strings, All, or None.
• Use the Replace null values with option to replace null values with specified string in the output file. Default is
set to ‘NULL’.
Use the fields on the Display panel to specify your preferences for the Query Tool display.
• When the Connection status switch is set to True, each new instance of the Query Tool will display connection
and transaction status.
• Use the Connection status refresh rate field to specify the number of seconds between connection/transaction
status updates.
• When the Open in new browser tab switch is set to True, each new instance of the Query Tool will open in a
new browser tab.
• Use the Query info notifier timeout field to control the behaviour of the notifier that is displayed when query
execution completes. A value of -1 will disable the notifier, and a value of 0 will display it until clicked. If a
positive value above zero is specified, the notifier will be displayed for the specified number of seconds. The
default is 5.
Use the fields on the Editor panel to change settings of the query editor.
• When the Brace matching? switch is set to True, the editor will highlight pairs of matched braces.
• When the Code folding? switch is set to False, the editor will disable code folding. Disabling will improve
editor performance with large files.
• Use the Font size field to specify the font size that will be used in text boxes and editors.
• When the Insert bracket pairs? switch is set to True, the editor will automatically insert paired brackets.
• When the Line wrapping switch is set to True, the editor will implement line-wrapping behavior.
• When the Plain text mode? switch is set to True, the editor mode will be changed to text/plain. Keyword
highlighting and code folding will be disabled. This will improve editor performance with large files.
• Use the Tab size field to specify the number of spaces per tab character in the editor.
• When the Use spaces switch is set to True, the editor will insert spaces (instead of tab characters) when the tab
key or auto-indent are used.
Use the fields on the Explain panel to specify the level of detail included in a graphical EXPLAIN.
• When the Show Buffers? switch is set to True, graphical explain details will include information about buffer
usage.
• When the Show Costs? switch is set to True, graphical explain details will include information about the
estimated startup and total cost of each plan, as well as the estimated number of rows and the estimated width
of each row.
• When the Show Timing? switch is set to True, graphical explain details will include the startup time and time
spent in each node in the output.
• When the Verbose output? switch is set to True, graphical explain details will include extended information
about the query execution plan.
Use the fields on the Results grid panel to specify your formatting preferences for copied data.
• Use the Result copy field separator drop-down listbox to select the field separator for copied data.
• Use the Result copy quote character drop-down listbox to select the quote character for copied data.
• Use the Result copy quoting drop-down listbox to select which type of fields require quoting; select All, None,
or Strings.
Use the fields on the Keyboard shortcuts panel to configure shortcuts for the Query Tool window navigation:
Use the Ignore whitespaces switch to ignores the whitespaces while comparing the string objects. Whitespace includes
space, tabs, and CRLF.
Use the Open in new browser tab switch to indicate if you would like Schema Diff to open in a new tab.
Keyboard shortcuts are provided in pgAdmin to allow easy access to specific functions. Alternate shortcuts can be
configured through File > Preferences if desired.´´
When using main browser window, the following keyboard shortcuts are available:
Use the shortcuts below when working with property grid controls:
When using the syntax-highlighting SQL editors, the following shortcuts are available:
When using the Query Tool, the following shortcuts are available:
1.12.6 Debugger
When using the Query Tool and Debugger, the following shortcuts are available for inner panel navigation:
<accesskey> is browser and platform dependant. The following table lists the default access keys for supported
browsers.
With this dialog, you can search for almost any kind of objects in a database.
You can access it by right clicking a database or any of its child nodes and select “Search objects”. You can also access
it by hitting the shortcut (default ALT+SHIFT+S).
The minimum pattern length are 3 characters. The search performed is non-casesensitive and will find all objets whose
name contains the pattern. You can only search for object names currently. Examples are: abc, %ab%, ab%c, %%%,
etc.
The result is presented in the grid with object name, object type and the object tree path in the browser. You can
double click on a result row to select the object in the browser. If the object is greyed out, this means that you have not
enabled those object types in the preferences, so you can’t double click on it. You can click on the ellipsis appended
to the function and procedure names to see there arguments.
You can filter based on a particular object type by selecting one from the object type dropdown. If the search button is
hit when one of the object type is selected then only those types will be fetch from the database. An object type will
not be visible in the dropdown if the database server does not support it or if it is not enabled from the preferences.
Before using pgAdmin to manage objects that reside on a server, you must define a connection to the server; for more
information please see Connecting to a Server in the next section.
Connecting To A Server
Before you can use the pgAdmin client to manage the objects that reside on your Postgres server, you must define
a connection to the server. You can (optionally) use the Server Group dialog to create server groups to organize the
server connections within the tree control for easier management. To open the Server Group dialog, right-click on the
Servers node of the tree control, and select Server Group from the Create menu.
Use the Server Group dialog to add a new server group. Assign servers to server groups to simplify management of
multiple servers. Server groups are displayed as part of the pgAdmin tree control.
Use the Name field on the Server Group dialog to specify a name that will identify the server group in the pgAdmin
tree control.
• Click the Save button to save work.
• Click the Cancel button to exit without saving work.
• Click the Reset button to restore configuration parameters.
To create server connections in a server group, right click on the named server group and select the Create option to
open the Create - Server dialog.
Use the fields on the Server dialog to define the connection properties for each new server that you wish to manage
with pgAdmin. To open the Server dialog, right-click on the Servers node of the tree control, and select Server from
the Create menu.
67
pgAdmin 4 Documentation, Release 4.25
Use the Server dialog to describe a connection to a server. Note: you must ensure that the pg_hba.conf file of the
server from which you are connecting allows connections from the host of the client.
Warning: In Server mode, certificates, private keys, and the revocation list are stored in the per-user file storage
area on the server, which is owned by the user account under which the pgAdmin server process is run. This means
that administrators of the server may be able to access those files; appropriate caution should be taken before
choosing to use this feature.
Use the fields in the SSH Tunnel tab to configure SSH Tunneling:
You can use the “SSH Tunnel” tab to connect pgAdmin (through an intermediary proxy host) to a server that resides
on a network to which the client may not be able to connect directly.
• Set “Use SSH tunneling” to Yes to specify that pgAdmin should use an SSH tunnel when connecting to the
specified server.
• Specify the name or IP address of the SSH host (through which client connections will be forwarded) in the
Tunnel host field.
• Specify the port of the SSH host (through which client connections will be forwarded) in the Tunnel port field.
• Specify the name of a user with login privileges for the SSH host in the Username field.
• Specify the type of authentication that will be used when connecting to the SSH host in the Authentication field:
– Select the Password option to specify that pgAdmin will use a password for authentication to the SSH
host. This is the default.
– Select the Identity file to specify that pgAdmin will use a private key file when connecting.
• If the SSH host is expecting a private key file for authentication, use the Identity file field to specify the location
of the key file.
• If the SSH host is expecting a password of the user name or an identity file if being used, use the Password field
to specify the password.
• Check the box next to Save password? to instruct pgAdmin to save the password for future use. Use Clear SSH
Tunnel Password to remove the saved password.
Click the Advanced tab to continue.
Note: The password file option is only supported when pgAdmin is using libpq v10.0 or later to connect to the server.
Use Clear Saved Password functionality to clear the saved password for the database server.
Clear Saved Password shows in the context menu for the selected server as well as under the Object menu on the top
menu bar.
Use Clear SSH Tunnel Password functionality to clear the saved password of SSH Tunnel to connect to the database
server.
Clear SSH Tunnel Password shows in the context menu for the selected server as well as under the Object menu on
the top menu bar.
Note: It will be enabled/visible when the password for the selected database server is already saved.
A master password is required to secure and later unlock saved server passwords. It is set by the user and can be
disabled using config.
A master password is required to secure and later unlock the saved server passwords. This is applicable only for
desktop mode users.
• You are prompted to enter the master password when you open the window for the first time after starting the
application.
• Once you set the master password, all the existing saved passwords will be re-encrypted using the master pass-
word.
• The server passwords which are saved in the SQLite DB file are encrypted and decrypted using the master
password.
• You can disable the master password by setting the configuration parameter MAS-
TER_PASSWORD_REQUIRED=False. See Desktop Deployment for more information.
Note: If the master password is disabled, then all the saved passwords will be removed.
Warning: If the master password is disabled, then the saved passwords will be encrypted using a key which is
derived from information within the configuration database. Use of a master password ensures that the encryption
key does not need to be stored anywhere, and thus prevents possible access to server credentials if the configuration
database becomes available to an attacker.
It is strongly recommended that you use the master password if you use the Save Password option.
• The master password is not stored anywhere on the physical storage. It is temporarily stored in the application
memory and it does not get saved when the application is restarted.
• You are prompted to enter the master password when pgAdmin server is restarted.
• If you forget the master password, you can use the Reset Master Password button to reset the password.
Warning: Resetting the master password will also remove all saved passwords and close all existing established
connections.
After defining a server connection, right-click on the server name, and select Connect to server to authenticate with
the server, and start using pgAdmin to manage objects that reside on the server.
Use the Connect to Server dialog to authenticate with a defined server and access the objects stored on the server
through the pgAdmin tree control. To access the dialog, right click on the server name in the pgAdmin tree control,
and select Connect Server. . . from the context menu.
When connecting to a PostgreSQL server, you may get an error message. If you encounter an error message, please
review the message carefully; each error message attempts to incorporate the information you’ll need to resolve the
problem. For more details about specific errors, please locate the error message in the list below:
Connection to the server has been lost
This error message indicates that the connection attempt has taken longer than the specified threshold; there may be a
problem with the connection properties provided on the Server dialog, network connectivity issues, or the server may
not be running.
could not connect to Server: Connection refused
If pgAdmin displays this message, there are two possible reasons for this:
• the database server isn’t running - simply start it.
• the server isn’t configured to accept TCP/IP requests on the address shown.
For security reasons, a PostgreSQL server “out of the box” doesn’t listen on TCP/IP ports. Instead, it must be enabled
to listen for TCP/IP requests. This can be done by adding listen_addresses=’*’; this will make the server accept
connections on any IP interface.
For further information, please refer to the PostgreSQL documentation about runtime configuration.
FATAL: no pg_hba.conf entry
If pgAdmin displays this message when connecting, your server can be contacted correctly over the network, but is
not configured to accept your connection. Your client has not been detected as a legal user for the database.
To connect to a server, the pg_hba.conf file on the database server must be configured to accept connections from the
host of the pgAdmin client. Modify the pg_hba.conf file on the database server host, and add an entry in the form:
• host template1 postgres 192.168.0.0/24 md5 for an IPV4 network
• host template1 postgres ::ffff:192.168.0.0/120 md5 for an IPV6 network
For more information, please refer to the PostgreSQL documentation about client authentication.
FATAL: password authentication failed
The password authentication failed for user error message indicates there may be a problem with the password you
entered. Retry the password to confirm you entered it correctly. If the error message returns, make sure that you have
the correct password, that you are authorized to access the server, and that the access has been correctly configured in
the server’s postgresql.conf configuration file.
Server definitions (and their groups) can be exported to a JSON file and re-imported to the same or a different system
to enable easy pre-configuration of pgAdmin.
Server definitions (and their groups) can be exported to a JSON file and re-imported to the same or a different system
to enable easy pre-configuration of pgAdmin. The setup.py script is used for this purpose.
Note: To export or import servers, you must use the Python interpreter that is normally used to run pgAdmin to ensure
that the required Python packages are available. In most packages, this can be found in the Python Virtual Environment
that can be found in the installation directory. When using platform-native packages, the system installation of Python
may be the one used by pgAdmin.
To export the servers defined in an installation, simply invoke setup.py with the --dump-servers command
line option, followed by the name (and if required, path) to the desired output file. By default, servers owned by
the desktop mode user will be dumped ([email protected] by default - see the DESKTOP_USER setting in
config.py). This can be overridden with the --user command line option. There can be multiple configuations
of pgAdmin on the same system. To dump the servers from specific pgAdmin config DB file, --sqlite-path
option can be used. It is also recommended to use this option when running pgAdmin in desktop mode. By default
SQLITE_PATH setting in config.py is taken. For example:
/path/to/python /path/to/setup.py --dump-servers output_file.json
To export only certain servers, use the --servers option and list one or more server IDs. For example:
/path/to/python /path/to/setup.py --dump-servers output_file.json --server 1 2 5
To import the servers defined in a JSON file, simply invoke setup.py with the --load-servers command
line option, followed by the name (and if required, path) of the JSON file containing the server definitions. Servers
will be owned by the desktop mode user ([email protected] by default - see the DESKTOP_USER setting in
config.py). This can be overridden with the --user command line option. There can be multiple configuations
of pgAdmin on the same system. To load the servers into a specific pgAdmin config DB file, --sqlite-path
option can be used. It is also recommended to use this option when running pgAdmin in desktop mode. By default
SQLITE_PATH setting in config.py is taken. For example:
/path/to/python /path/to/setup.py --load-servers input_file.json
If any Servers are defined with a Server Group that is not already present in the configuration database, the required
Group will be created.
The JSON file format used when importing or exporting servers is quite straightforward and simply contains a list
of servers, with a number of attributes. The following attributes are required to be present in every server definition:
Name, Group, Port, Username, SSLMode, MaintenanceDB and one of Host, HostAddr or Service.
Password fields cannot be imported or exported.
The following example shows both a minimally defined and a fully defined server:
{
"Servers": {
"1": {
"Name": "Minimally Defined Server",
"Group": "Server Group 1",
"Port": 5432,
"Username": "postgres",
"Host": "localhost",
"SSLMode": "prefer",
"MaintenanceDB": "postgres"
},
"2": {
"Name: "Fully Defined Server",
"Group": "Server Group 2",
"Host": "host.domain.com",
"HostAddr": "192.168.1.2",
"Port": 5432,
"MaintenanceDB": "postgres",
"Username": "postgres",
"Role": "my_role_name",
"SSLMode": "require",
"Comment": "This server has every option configured in the JSON",
"DBRestriction": "live_db test_db",
"PassFile": "/path/to/pgpassfile",
"SSLCert": "/path/to/sslcert.crt",
"SSLKey": "/path/to/sslcert.key",
"SSLRootCert": "/path/to/sslroot.crt",
"SSLCrl": "/path/to/sslcrl.crl",
"SSLCompression": 1,
"BGColor": "#ff9900",
"FGColor": "#000000",
"Service": "postgresql-10",
"Timeout": 60,
"UseSSHTunnel": 1,
"TunnelHost": "192.168.1.253",
"TunnelPort": 22,
"TunnelUsername": "username",
(continues on next page)
Some object definitions reside at the cluster level; pgAdmin 4 provides dialogs that allow you to create these objects,
manage them, and control their relationships to each other. To access a dialog that allows you to create a database
object, right-click on the object type in the pgAdmin tree control, and select the Create option for that object. For
example, to create a new database, right-click on the Databases node, and select Create Database. . .
Use the Database dialog to define or modify a database. To create a database, you must be a database superuser or
have the CREATE privilege.
The Database dialog organizes the development of a database through the following dialog tabs: General, Definition,
Security, and Parameters. The SQL tab displays the SQL code generated by dialog selections.
81
pgAdmin 4 Documentation, Release 4.25
Use the Security tab to assign privileges and define security labels.
Use the Privileges panel to assign privileges to a role. Click the Add icon (+) to set privileges for database objects:
• 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.
Click add to set additional privileges; to discard a privilege, click the trash icon to the left of the row and confirm
deletion in the Delete Row popup.
Use the Security Labels panel to define security labels applied to the database. Click the Add icon (+) to add each
security label selection:
• 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.
To discard a security label, click the trash icon to the left of the row and confirm deletion in the Delete Row popup.
Click the Parameters tab to continue.
Use the Parameters tab to set parameters for the database. Click the Add icon (+) to add each parameter:
• Use the drop-down listbox in the Name field to select a parameter.
• Use the Value field to set a value for the parameter.
• Use the drop-down listbox next to Role to select a role to which the parameter setting specified will apply.
Follow these steps to add additional parameter value definitions; to discard a parameter, click the trash icon to the left
of the row and confirm deletion in the Delete Row popup.
Click the Advanced tab to continue.
Use the Advanced tab to set advanced parameters for the database.
• Use Schema restriction field to provide a SQL restriction that will be used against the pg_namespace table to
limit the schemas that you see. For example, you might enter: public so that only public are shown in the
pgAdmin browser.Separate entries with a comma or tab as you type.
Click the SQL tab to continue.
Your entries in the Database 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.
3.1.1 Example
The following is an example of the sql command generated by user selections in the Database dialog:
The example creates a database named hr that is owned by postgres. It allows unlimited connections, and is available
to all authenticated users.
• Click the Info button (i) to access online help.
• Click the Save button to save work.
• Click the Cancel button to exit without saving work.
• Click the Reset button to restore configuration parameters.
Use the Move Objects dialog to to move database objects from one tablespace to another tablespace.
The Move Objects dialog organizes the movement of database objects with the General tab; the SQL tab displays the
SQL code generated by dialog selections.
Use the fields in the General tab to identify the items that will be moved and the tablespace to which they will be
moved:
• Use the New tablespace drop-down listbox to select a pre-existing tablespace to which the object will be moved.
(To create a tablespace, use the Tablespace dialog; access the dialog by right clicking Tablespaces in the pgAd-
min tree control and selecting Create Tablespace. . . from the context-menu.)
• Use the Object type drop-down listbox to select from the following:
– Select All to move all tables, indexes, and materialized views from the current tablespace (currently se-
lected in the pgAdmin tree control) to the new tablespace.
– Select Tables to move tables from the current tablespace to the new tablespace.
– Select Indexes to move indexes from the current tablespace to the new tablespace.
– Select Materialized views to move materialized views from the current tablespace to the new tablespace.
• Use the Object owner drop-down listbox to select the role that owns the objects selected in the Object type field.
This field is optional.
Click the SQL tab to continue.
Your entries in the Move Objects dialog generate a SQL command (see an example below). Use the SQL tab for
review; revisit the General tab to modify the SQL command.
3.2.1 Example
The following is an example of the sql command generated by user selections in the Move Objects dialog:
The example shown demonstrates moving materialized views owned by Alice from tablespace tbspace_01 to tb-
space_02.
• Click the Help button (?) to access online help.
• Click the OK button to save work.
• Click the Cancel button to exit without saving work.
Use the Resource Group dialog to create a resource group and set values for its resources. A resource group is a
named, global group on which various resource usage limits can be defined. The resource group is accessible from
all databases in the cluster. To use the Resource Group dialog, you must have superuser privileges. Please note that
resource groups are supported when connected to EDB Postgres Advanced Server; for more information about using
resource groups, please see the EDB Postgres Advanced Server Guide, available at:
http://www.enterprisedb.com/
Fields used to create a resource group are located on the General tab. The SQL tab displays the SQL code generated
by your selections on the Resource Group dialog.
Use the fields on the General tab to specify resource group attributes:
• Use the Name field to add a descriptive name for the resource group. This name will be displayed in the tree
control.
• Use the CPU rate limit (%) field to set the value of the CPU rate limit resource type assigned to the resource
group. The valid range for a CPU rate limit is from 0 to 1.67772e+07. The default value is 0.
• Use the Dirty rate limit (KB) field to set the value of the dirty rate limit resource type assigned to the resource
group. The valid range for a dirty rate limit is from 0 to 1.67772e+07. The default value is 0.
Click the SQL tab to continue.
Your entries in the Resource Group dialog generate a SQL command. Use the SQL tab for review; revisit the General
tab to make any changes to the SQL command.
3.3.1 Example
The following is an example of the sql command generated by selections made in the Resource Group dialog:
The example creates a resource group named acctg that sets cpu_rate_limit to 2, and dirty_rate_limit to 6144.
• Click the Info button (i) to access online SQL syntax reference material.
• Click the Help button (?) to access online documentation about Resource Groups.
• Click the Save button to save work.
• Click the Cancel button to exit without saving work.
• Click the Reset button to restore configuration parameters.
Use the Login/Group Role dialog to define a role. A role may be an individual user (with or without login privileges)
or a group of users. Note that roles defined at the cluster level are shared by all databases in the cluster.
The Login/Group Role dialog organizes the creation and management of roles through the following dialog tabs:
General, Definition, Privileges, Parameters, and Security. The SQL tab displays the SQL code generated by dialog
selections.
Use the Definition tab to set a password and configure connection rules:
• Provide a password that will be associated with the role in the Password field.
• Provide an expiration date for the password in the Account Expires field (the role does not expire). The expiration
date is not enforced when a user logs in with a non-password-based authentication method.
• If the role is a login role, specify how many concurrent connections the role can make in the Connection Limit
field. The default value (-1) allows unlimited connections.
Click the Privileges tab to continue.
• Specify members of the role in the Role Membership field. Click inside the Roles field to select role names
from a drop down list. Confirm each selection by checking the checkbox to the right of the role name; delete
a selection by clicking the x to the left of the role name. Membership conveys the privileges granted to the
specified role to each of its members.
Click the Parameters tab to continue.
Use the fields on the Parameters tab to set session defaults for a selected configuration parameter when the role is
connected to a specified database. This tab invokes the ALTER ROLE. . . SET configuration_parameter syntax. Click
Use the Security tab to define security labels applied to the role. Click the Add icon (+) to add each security label
selection.
• 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.
To discard a security label, 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 Login/Group Role 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.
3.4.1 Example
The following is an example of the sql command generated by user selections in the Login/Group Role dialog:
The example creates a login role named alice with pem_user privileges; the role can make unlimited connections to
the server at any given time.
• Click the Info button (i) to access online SQL help.
• Click the Help button (?) to access the documentation for the 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.
Use The Tablespace dialog to define a tablespace. A tablespace allows superusers to define an alternative location on
the file system where the data files containing database objects (such as tables and indexes) reside. Tablespaces are
only supported on systems that support symbolic links. Note that a tablespace cannot be used independently of the
cluster in which it is defined.
The Tablespace dialog organizes the definition of a tablespace through the following tabs: General, Definition, Pa-
rameters, and Security. The SQL tab displays the SQL code generated by dialog selections.
• Use the Name field to identify the tablespace with a descriptive name. The name cannot begin with pg_; these
names are reserved for system tablespaces.
• Select the owner of the tablespace from the drop-down listbox in the Owner field.
• Store notes about the tablespace in the Comment field.
Click the Definition tab to continue.
• Use the Location field to specify an absolute path to a directory that will contain the tablespace.
Use the Parameters tab to set parameters for the tablespace. Click the Add icon (+) to add a row to the table below.
• Use the drop-down listbox next to Name to select a parameter.
• Use the Value field to set a value for the parameter.
Click the Add icon (+) to specify each additional parameter; to discard a parameter, click the trash icon to the left of
the row and confirm deletion in the Delete Row dialog.
Click the Security tab to continue.
Use the Security tab to assign privileges and define security labels for the tablespace.
Use the Privileges panel to assign security privileges. Click the Add icon (+) to assign a set of privileges:
• Select the name of the role from the drop-down listbox in the Grantee field.
• The current user, who is the default grantor for granting the privilege, is displayed in the Grantor field.
• Click inside the Privileges field. Check the boxes to the left of one or more privileges to grant the selected
privileges to the specified user.
Click the Add icon to assign additional sets of privileges; to discard a privilege, click the trash icon to the left of the
row and confirm deletion in the Delete Row popup.
Use the Security Labels panel to define security labels applied to the tablespace. Click the Add icon (+) to add each
security label selection:
• 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.
To discard a security label, 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 Tablespace 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.
3.5.1 Example
The following is an example of the sql command generated by user selections in the Tablespace dialog:
The example shown demonstrates creating a tablespace named space_01. It has a random_page_cost value equal to 1.
• Click the Info button (i) to access online help.
• Click the Save button to save work.
• Click the Cancel button to exit without saving work.
• Click the Reset button to restore configuration parameters.
pgAdmin 4 provides simple but powerful dialogs that you can use to design and create database objects. Each dialog
contains a series of tabs that you use to describe the object that will be created by the dialog; the SQL tab displays the
SQL command that the server will execute when creating the object.
To access a dialog that allows you to create a database object, right-click on the object type in the pgAdmin tree
control, and select the Create option for that object. For example, to create a new cast, right-click on the Casts node,
and select Create Cast. . .
Use the Cast dialog to define a cast. A cast specifies how to convert a value from one data type to another.
The Cast dialog organizes the development of a cast through the following dialog tabs: General and Definition. The
SQL tab displays the SQL code generated by dialog selections.
99
pgAdmin 4 Documentation, Release 4.25
The cast uses a function named int4(bigint) to convert a biginteger data type to an integer.
• Click the Info button (i) to access online help.
• Click the Save button to save work.
• Click the Cancel button to exit without saving work.
• Click the Reset button to restore configuration parameters.
Use the Collation dialog to define a collation. A collation is an SQL schema object that maps a SQL name to operating
system locales. To create a collation, you must have a CREATE privilege on the destination schema.
The Collation dialog organizes the development of a collation through the following dialog tabs: General and Defini-
tion. The SQL tab displays the SQL code generated by dialog selections.
Use the fields in the Definition tab to specify the operating system locale settings:
• Use the drop-down listbox next to Copy collation to select the name of an existing collation to copy. The new
collation will have the same properties as the existing one, but will be an independent object. If you choose to
copy an existing collation, you cannot modify the collation properties displayed on this tab.
• Use the Locale field to specify a locale; a locale specifies language and language formatting characteristics. If
you specify this, you cannot specify either of the following parameters. To view a list of locales supported by
your Linux system use the command locale -a.
• Use the LC_COLLATE field to specify a locale with specified string sort order. The locale must be applicable to
the current database encoding. (See CREATE DATABASE for details.)
• Use the LC_CTYPE field to specify a locale with specified character classification. The locale must be applicable
to the current database encoding. (See CREATE DATABASE for details.)
Click the SQL tab to continue.
Your entries in the Collation dialog generate a SQL command (see an example b elow). Use the SQL tab for review;
revisit or switch tabs to make any changes to the SQL command.
4.2.1 Example
The following is an example of the sql command generated by user selections in the Collation dialog:
The example shown demonstrates creating a collation named french that uses the rules specified for the locale, fr-BI-
x-icu. The collation is owned by *postgres.
• Click the Info button (i) to access online help. For more information about setting a locale, see Chapter 22.1
Locale Support of the PostgreSQL core documentation:
https://www.postgresql.org/docs/current/locale.html
• Click the Save button to save work.
• Click the Cancel button to exit without saving work.
• Click the Reset button to restore configuration parameters.
Use the Domain dialog to define a domain. A domain is a data type definition that may constrain permissible values.
Domains are useful when you are creating multiple tables that contain comparable columns; you can create a domain
that defines constraints that are common to the columns and re-use the domain definition when creating the columns,
rather than individually defining each set of constraints.
The Domain dialog organizes the development of a domain through the following tabs: General, Definition, Con-
straints, and Security. The SQL tab displays the SQL code generated by dialog selections.
Use the fields in the Constraints tab to specify rules for the domain. Click the Add icon (+) to set constraints:
• Use the Name field to specify a name for the constraint.
• Use the Check field to provide an expression for the constraint.
• Use the Validate checkbox to determine whether the constraint will be validated. The default checkbox is
checked and sets a validation requirement.
A CHECK clause specifies an integrity test which values of the domain must satisfy. Each constraint must be an
expression that produces a Boolean result. Use the key word VALUE to refer to the value being tested. Expressions
evaluating to TRUE or UNKNOWN succeed. If the expression produces a FALSE result, an error is reported and the
value is not allowed to be converted to the domain type. A CHECK expression cannot contain subqueries nor refer to
variables other than VALUE. If a domain has multiple CHECK constraints, they will be tested in alphabetical order
by name.
Click the Add icon (+) to set additional constraints; to discard a constraint, click the trash icon to the left of the row
and confirm deletion in the Delete Row popup.
Click the Security tab to continue.
Use the Security Labels panel to assign security labels. Click the Add icon (+) to add a label:
• 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.
Click the Add icon (+) to specify each additional label; to discard a label, 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 Domain 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.
4.3.1 Example
The following is an example of the sql command generated by selections made in the Domain dialog:
The example shown demonstrates creating a domain named minimum-wage that confirms that the value entered is
greater than or equal to 7.25.
• Click the Info button (i) to access online help.
• Click the Save button to save work.
• Click the Cancel button to exit without saving work.
• Click the Reset button to restore configuration parameters.
Use the Domain Constraints dialog to create or modify a domain constraint. A domain constraint confirms that the
values provided for a domain meet a defined criteria. The Domain Constraints dialog implements options of the
ALTER DOMAIN command.
The Domain Constraints dialog organizes the development of a domain constraint through the following dialog tabs:
General and Definition. The SQL tab displays the SQL code generated by dialog selections.
Use the fields in the General tab to identify the domain constraint:
• Use the Name field to add a descriptive name for the constraint. The name will be displayed in the pgAdmin tree
control.
• Store notes about the constraint in the Comment field.
Click the Definition tab to continue.
Use the fields in the Definition tab to define the domain constraint:
• Use the Check field to provide a CHECK expression. A CHECK expression specifies a constraint that the
domain must satisfy. A constraint must produce a Boolean result; include the key word VALUE to refer to the
value being tested. Only those expressions that evaluate to TRUE or UNKNOWN will succeed. A CHECK
expression cannot contain subqueries or refer to variables other than VALUE. If a domain has multiple CHECK
constraints, they will be tested in alphabetical order.
• Move the Validate? switch to the No position to mark the constraint NOT VALID. If the constraint is marked
NOT VALID, the constraint will not be applied to existing column data. The default value is Yes.
Click the SQL tab to continue.
Your entries in the Domain Constraints 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.
4.4.1 Example
The following is an example of the sql command generated by user selections in the Domain Constraints dialog:
The example shown demonstrates creating a domain constraint on the domain timesheets named weekday. It constrains
a value to equal Friday.
• Click the Info button (i) to access online help.
• Click the Save button to save work.
• Click the Cancel button to exit without saving work.
• Click the Reset button to restore configuration parameters.
Use the Domain Trigger dialog to define an event trigger. Unlike regular triggers, which are attached to a single
table and capture only DML events, event triggers are global to a particular database and are capable of capturing
DDL events. Like regular triggers, event triggers can be written in any procedural language that includes event trigger
support, or in C, but not in SQL.
The Domain Trigger dialog organizes the development of a event trigger through the following dialog tabs: General,
Definition, and Security Labels. The SQL tab displays the SQL code generated by dialog selections.
Use the fields in the General tab to identify the event trigger:
• Use the Name field to add a descriptive name for the event trigger. The name will be displayed in the pgAdmin
tree control.
• Use the drop-down listbox next to Owner to specify the owner of the event trigger.
• Store notes about the event trigger in the Comment field.
Click the Definition tab to continue.
Use the fields in the Definition tab to define the event trigger:
• Select a value from the drop down of Trigger Enabled field to specify a status for the trigger: Enable Disable,
Replica Always.
• Use the drop-down listbox next to Trigger function to specify an existing function. A trigger function takes an
empty argument list, and returns a value of type event_trigger.
• Select a value from the drop down of Events field to specify when the event trigger will fire: DDL COMMAND
START, DDL COMMAND END, or SQL DROP.
• Use the When TAG in field to enter filter values for TAG for which the trigger will be executed. The values must
be in single quotes separated by comma.
Click the Security Labels tab to continue.
Use the Security tab to define security labels applied to the trigger. Click the Add icon (+) to add each security label.
• 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 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.
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.
Click the SQL tab to continue.
Your entries in the Domain Trigger dialog generate a generate a SQL command. Use the SQL tab for review; revisit
or switch tabs to make any changes to the SQL command.
4.5.1 Example
The following is an example of the sql command generated by user selections in the Domain Trigger dialog:
The command creates an event trigger named accounts that invokes the procedure named acct_due.
• Click the Info button (i) to access online help.
• Click the Save button to save work.
• Click the Cancel button to exit without saving work.
• Click the Reset button to restore configuration parameters.
Use the Extension dialog to install a new extension into the current database. An extension is a collection of SQL
objects that add targeted functionality to your Postgres installation. The Extension dialog adds the functionality of an
extension to the current database only; you must register the extension in each database that use the extension. Before
you load an extension into a database, you should confirm that any pre-requisite files are installed.
The Extension dialog allows you to implement options of the CREATE EXTENSION command through the following
dialog tabs: General and Definition. The SQL tab displays the SQL code generated by dialog selections.
• Use the drop-down listbox next to Schema to select the name of the schema in which to install the extension’s
objects.
• Use the drop-down listbox next to Version to select the version of the extension to install.
Click the SQL tab to continue.
Your entries in the Extension 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.
4.6.1 Example
The following is an example of the sql command generated by user selections in the Extension dialog:
The command creates the chkpass extension in the public schema. It is version 1.0 of chkpass.
• Click the Info button (i) to access online help.
• Click the Save button to save work.
• Click the Cancel button to exit without saving work.
• Click the Reset button to restore configuration parameters.
Use the Foreign Data Wrapper dialog to create or modify a foreign data wrapper. A foreign data wrapper is an adapter
between a Postgres database and data stored on another data source.
You must be a superuser to create a foreign data wrapper.
The Foreign Data Wrapper dialog organizes the development of a foreign data wrapper through the following dialog
tabs: General, Definition, Options, and Security. The SQL tab displays the SQL code generated by dialog selections.
Use the fields in the General tab to identify the foreign data wrapper:
• Use the Name field to add a descriptive name for the foreign data wrapper. A foreign data wrapper name must
be unique within the database. The name will be displayed in the pgAdmin tree control.
• Use the drop-down listbox next to Owner to select the name of the role that will own the foreign data wrapper.
• Store notes about the foreign data wrapper in the Comment field.
Click the Definition tab to continue.
Use the Security tab to assign security privileges. Click the Add icon (+) to assign a set of privileges.
• 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
privileges to the specified user.
• The current user, who is the default grantor for granting the privilege, is displayed in the Grantor field.
Click add 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 Foreign Data Wrapper 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.
4.7.1 Example
The following is an example of the sql command generated by user selections in the Foreign Data Wrapper dialog:
The example creates a foreign data wrapper named libpq_debug that uses pre-existing validator and handler functions,
dblink_fdw_validator and libpg_fdw_handler. Selections on the Options tab set debug equal to true. The foreign data
wrapper is owned by postgres.
• Click the Help button (?) to access online help.
• Click the Save button to save work.
• Click the Cancel button to exit without saving work.
• Click the Reset button to restore configuration parameters.
Use the Foreign Server dialog to create a foreign server. A foreign server typically encapsulates connection information
that a foreign-data wrapper uses to access an external data resource. Each foreign data wrapper may connect to a
different foreign server; in the pgAdmin tree control, expand the node of the applicable foreign data wrapper to launch
the Foreign Server dialog.
The Foreign Server dialog organizes the development of a foreign server through the following dialog tabs: General,
Definition, Options, and Security. The SQL tab displays the SQL code generated by dialog selections.
Use the fields in the General tab to identify the foreign server:
• Use the Name field to add a descriptive name for the foreign server. The name will be displayed in the pgAdmin
tree control. It must be unique within the database.
• Use the drop-down listbox next to Owner to select a role.
• Store notes about the foreign server in the Comment field.
Click the Definition tab to continue.
Use the fields in the Options tab to specify options. Click the Add button to create an option clause for the foreign
server.
Use the Security tab to assign security privileges to the foreign server. Click Add before you assign a set of privileges.
• 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
privileges to the specified user.
• The current user, who is the default grantor for granting the privilege, is displayed in the Grantor field.
Click Add to assign a new set of privileges; to discard a privilege, click the trash icon to the left of the row and confirm
deletion in the Delete Row dialog.
Click the SQL tab to continue.
Your entries in the Foreign Server 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.
4.8.1 Example
The following is an example of the sql command generated by user selections in the Foreign Server dialog:
The example shown demonstrates creating a foreign server for the foreign data wrapper hdfs_fdw. It has the name
hdfs_server; its type is hiveserver2. Options for the foreign server include a host and a port.
• Click the Info button (i) to access online help.
• Click the Save button to save work.
• Click the Cancel button to exit without saving work.
• Click the Reset button to restore configuration parameters.
Use the Foreign Table dialog to define a foreign table in the current database. Foreign tables define the structure of an
external data source that resides on a foreign server.
The Foreign Table dialog organizes the development of a foreign table through the following dialog tabs: General,
Definition, Columns, Constraints, Options, and Security. The SQL tab displays the SQL code generated by dialog
selections.
Use the fields in the General tab to identify the foreign table:
• Use the Name field to add a descriptive name for the foreign table. The name of the foreign table must be distinct
from the name of any other foreign table, table, sequence, index, view, existing data type, or materialized view
in the same schema. The name will be displayed in the pgAdmin tree control.
• Use the drop-down listbox next to Owner to select the name of the role that will own the foreign table.
• Select the name of the schema in which the foreign table will reside from the drop-down listbox in the Schema
field.
• Store notes about the foreign table in the Comment field.
Click the Definition tab to continue.
Use the fields in the Definition tab to define the external data source:
• Use the drop-down listbox next to Foreign server to select a foreign server. This list is populated with servers
defined through the Foreign Server dialog.
• Use the drop-down listbox next to Inherits to specify a parent table. The foreign table will inherit all of its
columns. This field is optional.
Click the Columns tab to continue.
Use the fields in the Columns tab to to add columns and their attributes to the table. Click the Add icon (+) to define a
column:
• Use the Name field to add a descriptive name for the column.
• Use the drop-down listbox in the Data Type field to select a data type for the column. This can include array
specifiers. For more information on which data types are supported by PostgreSQL, refer to Chapter 8 of the
core documentation.
Click the Add icon (+) to specify each additional column; to discard a column, click the trash icon to the left of the
row and confirm deletion in the Delete Row popup.
Click the Constraints tab to continue.
Use the fields in the Constraints tab to apply a table constraint to the foreign table. Click the Add icon (+) to define a
constraint:
• Use the Name field to add a descriptive name for the constraint. If the constraint is violated, the constraint name
is present in error messages, so constraint names like col must be positive can be used to communicate helpful
information.
• Use the Check field to write a check expression producing a Boolean result. Each row in the foreign table is
expected to satisfy the check expression.
• Check the No Inherit checkbox to specify that the constraint will not propagate to child tables.
• Uncheck the Validate checkbox to disable validation. The database will not assume that the constraint holds for
all rows in the table.
Click the Add icon (+) to specify each additional constraint; to discard a constraint, click the trash icon to the left of
the row and confirm deletion in he Delete Row popup.
Click the Options tab to continue.
Use the fields in the Options tab to specify options to be associated with the new foreign table or one of its columns;
the accepted option names and values are specific to the foreign data wrapper associated with the foreign server. Click
the Add icon (+) to add an option/value pair.
• Specify the option name in the Option field. Duplicate option names are not allowed.
• Provide a corresponding value in the Value field.
Click the Add icon (+) to specify each additional option/value pair; to discard an option, click the trash icon to the left
of the row and confirm deletion in the Delete Row popup.
Click the Security tab to continue.
Use the Security tab to assign privileges and define security labels.
Use the Privileges panel to assign privileges to a role. Click the Add icon (+) to set privileges for database objects:
• Select the name of the role to which privileges will be assigned 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.
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.
Use the Security Labels panel to define security labels applied to the function. Click the Add icon (+) to add each
security label selection:
• 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.
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.
Click the SQL tab to continue.
Your entries in the Foreign Table 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.
4.9.1 Example
The following is an example of the sql command generated by user selections in the Foreign Table dialog:
The example shown demonstrates creating a foreign table weblogs with multiple columns and two options.
• Click the Info button (i) to access online help.
• Click the Save button to save work.
• Click the Cancel button to exit without saving work.
• Click the Reset button to restore configuration parameters.
Use the FTS Configuration dialog to configure a full text search. A text search configuration specifies a text search
parser that can divide a string into tokens, along with dictionaries that can identify searchable tokens.
The FTS Configuration dialog organizes the development of a FTS configuration through the following dialog tabs:
“General, Definition, and Tokens. The SQL tab displays the SQL code generated by dialog selections.
Click the General tab to begin.
4.10.1 Example
The following is an example of the sql command generated by user selections in the FTS Configuration dialog:
The example shown demonstrates creating a FTS configuration named meme_phrases. It uses the default parser.
• Click the Info button (i) to access online help.
• Click the Save button to save work.
• Click the Cancel button to exit without saving work.
• Click the Reset button to restore configuration parameters.
Use the FTS Dictionary dialog to create a full text search dictionary. You can use a predefined templates or create a
new dictionary with custom parameters.
The FTS Dictionary dialog organizes the development of a FTS dictionary through the following dialog tabs: General,
Definition, and Options. The SQL tab displays the SQL code generated by dialog selections.
Use the field in the Definition tab to choose a template from the drop-down listbox:
• Select ispell to select the Ispell template. The Ispell dictionary template supports morphological dictionaries,
which can normalize many different linguistic forms of a word into the same lexeme. For example, an English
Ispell dictionary can match all declensions and conjugations of the search term bank, e.g., banking, banked,
banks, banks’, and bank’s. Ispell dictionaries usually recognize a limited set of words, so they should be fol-
lowed by another broader dictionary; for example, a Snowball dictionary, which recognizes everything.
• Select simple to select the simple template. The simple dictionary template operates by converting the input
token to lower case and checking it against a file of stop words. If it is found in the file then an empty array
is returned, causing the token to be discarded. If not, the lower-cased form of the word is returned as the
normalized lexeme. Alternatively, the dictionary can be configured to report non-stop-words as unrecognized,
allowing them to be passed on to the next dictionary in the list.
• Select snowball to select the Snowball template. The Snowball dictionary template is based on a project by
Martin Porter, inventor of the popular Porter’s stemming algorithm for the English language. Snowball now
provides stemming algorithms for many languages (see the Snowball site for more information). Each algorithm
understands how to reduce common variant forms of words to a base, or stem, spelling within its language. A
Snowball dictionary recognizes everything, whether or not it is able to simplify the word, so it should be placed
at the end of the dictionary list. It is useless to have it before any other dictionary because a token will never
pass through it to the next dictionary.
• Select synonym to select the synonym template. This dictionary template is used to create dictionaries that
replace a word with a synonym. Phrases are not supported (use the thesaurus template (Section 12.6.4) for that).
A synonym dictionary can be used to overcome linguistic problems, for example, to prevent an English stemmer
dictionary from reducing the word Paris to pari.
• Select thesaurus to select the thesaurus template. A thesaurus dictionary replaces all non-preferred terms by
one preferred term and, optionally, preserves the original terms for indexing as well. PostgreSQL’s current
implementation of the thesaurus dictionary is an extension of the synonym dictionary with added phrase support.
Click the Options tab to continue.
Use the fields in the Options tab to provide template-specific options. Click the Add icon (+) to add an option clause:
• Specify the name of an option in the Option field
• Provide a value for the option in the Value field.
Click the Add icon (+) to specify each additional option/value pair; to discard an option, 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 FTS Dictionary dialog generate a generate a SQL command. Use the SQL tab for review; revisit or
switch tabs to make any changes to the SQL command.
4.11.1 Example
The following is an example of the sql command generated by user selections in the FTS Dictionary dialog:
The example shown demonstrates creating a custom dictionary named more_stopwords which is based on the simple
template and is configured to use standard English.
• Click the Info button (i) to access online help.
• Click the Save button to save work.
• Click the Cancel button to exit without saving work.
• Click the Reset button to restore configuration parameters.
Use the FTS Parser dialog to create a new text search parser. A text search parser defines a method for splitting a text
string into tokens and assigning types (categories) to the tokens.
The FTS Parser dialog organizes the development of a text search parser through the following dialog tabs: General,
and Definition. The SQL tab displays the SQL code generated by dialog selections.
Use the fields in the General tab to identify a text search parser:
• Use the Name field to add a descriptive name for the parser. The name will be displayed in the pgAdmin tree
control.
• Select the name of the schema in which the parser will reside from the drop-down listbox in the Schema field.
• Store notes about the domain in the Comment field.
Click the Definition tab to continue.
Your entries in the FTS Parser dialog generate a generate a SQL command. Use the SQL tab for review; revisit or
switch tabs to make any changes to the SQL command.
• Click the Info button (i) to access online help.
• Click the Save button to save work.
• Click the Cancel button to exit without saving work.
• Click the Reset button to restore configuration parameters.
Use the FTS Template dialog to create a new text search template. A text search template defines the functions that
implement text search dictionaries.
The FTS Template dialog organizes the development of a text search Template through the following dialog tabs:
General, and Definition. The SQL tab displays the SQL code generated by dialog selections.
4.13.1 Example
The following is an example of the sql command generated by user selections in the FTS Template dialog:
The example shown demonstrates creating a fts template named ru_template that uses the ispell dictionary.
• Click the Info button (i) to access online help.
• Click the Save button to save work.
• Click the Cancel button to exit without saving work.
• Click the Reset button to restore configuration parameters.
Use the Function dialog to define a function. If you drop and then recreate a function, the new function is not the same
entity as the old; you must drop existing rules, views, triggers, etc. that refer to the old function.
The Function dialog organizes the development of a function through the following dialog tabs: General, Definition,
Code, Options, Parameters, and Security. The SQL tab displays the SQL code generated by dialog selections.
– Use the drop-down listbox in the Data type field to select a data type.
– Use the drop-down listbox in the Mode field to select a mode. Select IN for an input parameter; select OUT
for an output parameter; select INOUT for both an input and an output parameter; or, select VARIADIC to
specify a VARIADIC parameter.
– Provide a name for the argument in the Argument Name field.
– Specify a default value for the argument in the Default Value field.
Click the Add icon (+) to define another argument; to discard an argument, click the trash icon to the left of the row
and confirm deletion in the Delete Row popup.
Click the Code tab to continue.
• Use the Code field to write the code that will execute when the function is called.
Click the Options tab to continue.
Use the fields in the Options tab to describe or modify the action of the function:
• Use the drop-down listbox next to Volatility to select one of the following. VOLATILE is the default value.
– VOLATILE indicates that the function value can change even within a single table scan, so no optimizations
can be made.
– STABLE indicates that the function cannot modify the database, and that within a single table scan it will
consistently return the same result for the same argument values.
– IMMUTABLE indicates that the function cannot modify the database and always returns the same result
when given the same argument values.
• Move the Returns a Set? switch to indicate if the function returns a set that includes multiple rows. The default
is No.
• Move the Strict? switch to indicate if the function always returns NULL whenever any of its arguments are
NULL. If Yes, the function is not executed when there are NULL arguments; instead a NULL result is assumed
automatically. The default is No.
• Move the Security of definer? switch to specify that the function is to be executed with the privileges of the user
that created it. The default is No.
• Move the Window? switch to indicate that the function is a window function rather than a plain function.
The default is No. This is currently only useful for functions written in C. The WINDOW attribute cannot be
changed when replacing an existing function definition. For more information about the CREATE FUNCTION
command, see the PostgreSQL core documentation available at:
https://www.postgresql.org/docs/current/functions-window.html
• Use the Estimated cost field to specify a positive number representing the estimated execution cost for the
function, in units of cpu_operator_cost. If the function returns a set, this is the cost per returned row.
• Use the Estimated rows field to specify a positive number giving the estimated number of rows that the query
planner should expect the function to return. This is only allowed when the function is declared to return a set.
The default assumption is 1000 rows.
• Move the Leak proof? switch to indicate whether the function has side effects. The default is No. This option
can only be set by the superuser.
• Use the Support function field to specify a planner support function to use for the function.
Click the Parameters tab to continue.
Use the fields in the Parameters tab to specify settings that will be applied when the function is invoked. Click the Add
icon (+) to add a Name/Value field in the table.
• Use the drop-down listbox in the Name column in the Parameters panel to select a parameter.
• Use the Value field to specify the value that will be associated with the selected variable. This field is context-
sensitive.
Click the Security tab to continue.
Use the Security tab to assign privileges and define security labels.
Use the Privileges panel to assign usage privileges for the function to a role.
• 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.
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.
Use the Security Labels panel to define security labels applied to the function. Click the Add icon (+) to add each
security label selection:
• 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.
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.
Click the SQL tab to continue.
Your entries in the Function dialog generate a 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.
4.14.1 Example
The following is an example of the sql command generated by selections made in the Function dialog:
The example demonstrates creating an plpgsql function named hire_salesmen. The function have three columns
(p_ename, p_sal and p_comm).
• Click the Info button (i) to access online help.
• Click the Save button to save work.
• Click the Cancel button to exit without saving work.
Use the Security tab to assign privileges and define security labels.
Use the Privileges panel to assign privileges to a role. Click the Add icon (+) to set privileges for database objects:
• 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.
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.
Use the Security Labels panel to define security labels applied to the function. Click the Add icon (+) to add each
security label selection:
• 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.
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.
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.
4.15.1 Example
The following is an example of the sql command generated by user selections in the Language dialog:
The example shown demonstrates creating the procedural language named plperl.
• Click the Info button (i) to access online help.
• Click the Save button to save work.
• Click the Cancel button to exit without saving work.
• Click the Reset button to restore configuration parameters.
Use the Materialized View dialog to define a materialized view. A materialized view is a stored or cached view that
contains the result set of a query. Use the REFRESH MATERIALIZED VIEW command to update the content of a
materialized view.
The Materialized View dialog organizes the development of a materialized_view through the following dialog tabs:
General, Definition, Storage, Parameter, and Security. The SQL tab displays the SQL code generated by dialog
selections.
Use the fields in the General tab to identify the materialized view:
• Use the Name field to add a descriptive name for the materialized view. The name will be displayed in the
pgAdmin tree control.
• Use the drop-down listbox next to Owner to select the role that will own the materialized view.
• Select the name of the schema in which the materialized view will reside from the drop-down listbox in the
Schema field.
• Store notes about the materialized view in the Comment field.
Click the Definition tab to continue.
Use the text editor field in the Definition tab to provide the query that will populate the materialized view. Please
note that updating the definition of existing materialized view would result in loss of Parameter(Table, Toast), Secu-
rity(Privileges & Security labels), Indexes and other dependent objects.
Click the Storage tab to continue.
Use the fields in the Storage tab to maintain the materialized view:
• Move the With Data switch to the Yes position to specify the materialized view should be populated at creation
time. If not, the materialized view cannot be queried until you invoke REFRESH MATERIALIZED VIEW.
• Use the drop-down listbox next to Tablespace to select a location for the materialized view.
• Use the Fill Factor field to specify a fill factor for the materialized view. The fill factor for a table is a percentage
between 10 and 100. 100 (complete packing) is the default.
Click the Parameter tab to continue.
Use the tabs nested inside the Parameter tab to specify VACUUM and ANALYZE thresholds; use the Table tab and
the Toast Table tab to customize values for the table and the associated toast table. To change the default values:
• Move the Custom auto-vacuum? switch to the Yes position to perform custom maintenance on the materialized
view and to select values in the Vacuum table. The Vacuum Table provides default values for maintenance
operations.
• Changing Autovacuum enabled? to Not set will reset autovacuum_enabled.
Click the Security tab to continue.
Use the Security tab to assign privileges and define security labels.
Use the Privileges panel to assign privileges to a role. Click the Add icon (+) to set privileges for the materialized
view:
• 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.
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.
Use the Security Labels panel to define security labels applied to the materialized view. Click the Add icon (+) to add
each security label selection:
• 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.
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.
Click the SQL tab to continue.
Your entries in the Materialized View 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.
4.16.1 Example
The following is an example of the sql command generated by user selections in the Materialized View dialog:
The example shown creates a query named new_hires that stores the result of the displayed query in the pg_default
tablespace.
• Click the Info button (i) to access online help.
• Click the Save button to save work.
• Click the Cancel button to exit without saving work.
• Click the Reset button to restore configuration parameters.
Use the Header field to define the public interface for the package.
Click the Body tab to continue.
Use the Body field to provide the code that implements each package object.
Click the Security tab to continue.
Use the fields in the Security tab to 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:
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 Cancel button to exit without saving work.
• Click the Reset button to delete any changes to the dialog.
Use the Procedure dialog to create a procedure; procedures are supported by PostgreSQL v11+ and EDB Postgres
Advanced Server. The Procedure dialog allows you to implement options of the CREATE PROCEDURE command.
The Procedure dialog organizes the development of a procedure through the following dialog tabs: General, Definition,
Options, Arguments, Parameters, and Security. The SQL tab displays the SQL code generated by dialog selections.
Use the fields in the Options tab to describe or modify the behavior of the procedure:
• Use the drop-down listbox under Volatility to select one of the following. VOLATILE is the default value.
– VOLATILE indicates that the value can change even within a single table scan, so no optimizations can be
made.
– STABLE indicates that the procedure cannot modify the database, and that within a single table scan it will
consistently return the same result for the same argument values, but that its result could change across
SQL statements.
– IMMUTABLE indicates that the procedure cannot modify the database and always returns the same result
when given the same argument values.
• Move the Strict? switch to indicate if the procedure always returns NULL whenever any of its arguments are
NULL. If Yes, the procedure is not executed when there are NULL arguments; instead a NULL result is assumed
automatically. The default is No.
• Move the Security of definer? switch to specify that the procedure is to be executed with the privileges of the
user that created it. The default is No.
• Use the Estimated cost field to specify a positive number representing the estimated execution cost for the
procedure, in units of cpu_operator_cost. If the procedure returns a set, this is the cost per returned row.
• Move the Leak proof? switch to indicate whether the procedure has side effects — it reveals no information
about its arguments other than by its return value. The default is No.
Click the Parameters tab to continue.
Use the fields in the Parameters tab to specify settings that will be applied when the procedure is invoked:
• Use the drop-down listbox next to Parameter Name in the Parameters panel to select a parameter.
• Click the Add button to add the variable to Name field in the table.
• Use the Value field to specify the value that will be associated with the selected variable. This field is context-
sensitive.
Click the Security tab to continue.
Use the Security tab to assign privileges and define security labels.
Use the Privileges panel to assign execute privileges for the procedure to a role:
• 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.
Click Add 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.
Use the Security Labels panel to define security labels applied to the procedure. Click Add to add each security label
selection:
• 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.
Click Add 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.
Click the SQL tab to continue.
Your entries in the Procedure 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.
4.18.1 Example
The following is an example of the sql command generated by selections made in the Procedure dialog:
The example demonstrates creating a procedure that returns a list of employees from a table named emp. The procedure
is a SECURITY DEFINER, and will execute with the privileges of the role that defined the procedure.
• Click the Info button (i) to access online help.
• Click the Save button to save work.
• Click the Cancel button to exit without saving work.
• Click the Reset button to restore configuration parameters.
Use the Schema dialog to define a schema. A schema is the organizational workhorse of a database, similar to direc-
tories or namespaces. To create a schema, you must be a database superuser or have the CREATE privilege.
The Schema dialog organizes the development of schema through the following dialog tabs: General and Security.
The SQL tab displays the SQL code generated by dialog selections.
Use the Security tab to assign privileges and security labels for the schema.
Click the Add icon (+) to assign a set of privileges in the Privileges panel:
• 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
privileges 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 sets of 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 Add icon (+) to assign a security label in the Security Labels panel:
• 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.
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.
Click the Default Privileges tab to continue.
Use the Default Privileges tab to grant privileges for tables, sequences, functions and types. Use the tabs nested inside
the Default Privileges tab to specify the database object and click the Add icon (+) to assign a set of privileges:
• Select the name of a role that will be granted privileges in the schema 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
privileges to the specified user.
• The current user, who is the default grantor for granting the privilege, is displayed in the Grantor field.
Click the SQL tab to continue.
Your entries in the Schema 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.
4.19.1 Example
The following is an example of the sql command generated by selections made in the Schema dialog:
The example creates a schema named hr; the command grants USAGE privileges to public and assigns the ability to
grant privileges to alice.
• Click the Info button (i) to access online help.
• Click the Save button to save work.
• Click the Cancel button to exit without saving work.
• Click the Reset button to restore configuration parameters.
Use the Sequence dialog to create a sequence. A sequence generates unique values in a sequential order (not necessarily
contiguous).
The Sequence dialog organizes the development of a sequence through the following dialog tabs: General, Definition,
and Security. The SQL tab displays the SQL code generated by dialog selections.
Use the Security tab to assign privileges and define security labels for the sequence.
Use the Privileges panel to assign privileges. Click the Add icon (+) to set privileges:
• Select the name of a role that will be granted privileges 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.
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.
Use the Security Labels panel to define security labels applied to the sequence. Click the Add icon (+) to add each
security label selection:
• 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.
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.
Click the SQL tab to continue.
Your entries in the Sequence dialog generate a 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.
4.20.1 Example
The following is an example of the sql command generated by user selections in the Sequence dialog:
The example shown demonstrates a sequence named seconds. The sequence will increase in 5 second increments, and
stop when it reaches a maximum value equal of 60.
• Click the Info button (i) to access online help.
• Click the Save button to save work.
• Click the Cancel button to exit without saving work.
• Click the Reset button to restore configuration parameters.
Use the Synonym dialog to substitute the name of a target object with a user-defined synonym.
The Synonym dialog organizes the development of a synonym through the General tab. The SQL tab displays the SQL
code generated by dialog selections.
The example creates a synonym for the emp table named emp_hist.
• Click the Save button to save work.
• Click the Cancel button to exit without saving work.
• Click the Reset button to restore configuration parameters.
Use the Trigger function dialog to create or manage a trigger_function. A trigger function defines the action that will
be invoked when a trigger fires.
The Trigger function dialog organizes the development of a trigger function through the following dialog tabs: Gen-
eral, Definition, Code, Options, Parameters and Security. The SQL tab displays the SQL code generated by dialog
selections.
Use the fields in the General tab to identify the trigger function:
• Use the Name field to add a descriptive name for the trigger function. The name will be displayed in the pgAdmin
tree control. Please note that trigger functions will be invoked in alphabetical order.
• Use the drop-down listbox next to Owner to select the role that will own the trigger function.
• Select the name of the schema in which the trigger function will reside from the drop-down listbox in the Schema
field.
• Store notes about the trigger function in the Comment field.
Click the Definition tab to continue.
Use the fields in the Definition tab to define the trigger function:
• Use the drop-down listbox next to Return type to specify the pseudotype that is associated with the trigger
function:
– Select trigger if you are creating a DML trigger.
– Select event_trigger if you are creating a DDL trigger.
• Use the drop-down listbox next to Language to select the implementation language. The default is plpgsql.
Click the Code tab to continue.
• Use the Code field to write the code that will execute when the trigger function is called.
Click the Options tab to continue.
Use the fields in the Options tab to describe or modify the action of the trigger function:
• Use the drop-down listbox next to Volatility to select one of the following:
– VOLATILE indicates that the trigger function value can change even within a single table scan.
– STABLE indicates that the trigger function cannot modify the database, and that within a single table scan
it will consistently return the same result for the same argument values.
– IMMUTABLE indicates that the trigger function cannot modify the database and always returns the same
result when given the same argument values.
• Move the Returns a Set? switch to indicate if the trigger function returns a set that includes multiple rows. The
default is No.
• Move the Strict? switch to indicate if the trigger function always returns NULL whenever any of its arguments
are NULL. If Yes, the function is not executed when there are NULL arguments; instead a NULL result is
assumed automatically. The default is No.
• Move the Security of definer? switch to specify that the trigger function is to be executed with the privileges of
the user that created it. The default is No.
• Move the Window? switch to indicate that the trigger function is a window function rather than a plain function.
The default is No. This is currently only useful for trigger functions written in C.
• Use the Estimated cost field to specify a positive number representing the estimated execution cost for the trigger
function, in units of cpu_operator_cost. If the function returns a set, this is the cost per returned row.
• Use the Estimated rows field to specify a positive number giving the estimated number of rows that the query
planner should expect the trigger function to return. This is only allowed when the function is declared to return
a set. The default assumption is 1000 rows.
• Move the Leak proof? switch to indicate whether the trigger function has side effects. The default is No. This
option can only be set by the superuser.
Click the Parameters tab to continue.
Use the fields in the Parameters tab to specify settings that will be applied when the trigger function is invoked. Click
the Add icon (+) to add a Name/Value pair to the table below.
• Use the drop-down listbox in the Name field to select a parameter.
• Use the Value field to specify the value that will be associated with the selected parameter. This field is context-
sensitive.
Click the Add icon (+) to set additional parameters; to discard a parameter, click the trash icon to the left of the row
and confirm deletion in the Delete Row popup.
Click the Security tab to continue.
Use the Security tab to assign privileges and define security labels.
Use the Privileges panel to assign usage privileges for the trigger function to a role. Click the Add icon (+) to to add a
role to the table.
• 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.
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.
Use the Security Labels panel to define security labels applied to the trigger function. Click the Add icon (+) to add
each security label selection:
• 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.
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.
Click the SQL tab to continue.
Your entries in the Trigger function dialog generate a SQL command (see an example below). Use the SQL tab for
review; revisit other tabs to modify the SQL command.
4.22.1 Example
The following is an example of the sql command generated by user selections in the Trigger function dialog:
Use the fields in the General tab to identify the custom data type:
• Use the Name field to add a descriptive name for the type. The name will be displayed in the pgAdmin tree
control. The type name must be distinct from the name of any existing type, domain, or table in the same
schema.
• Use the drop-down listbox next to Owner to select the role that will own the type.
• Select the name of the schema in which the type will reside from the drop-down listbox in the Schema field.
• Store notes about the type in the Comments field.
Click the Definition tab to continue.
Select a data type from the drop-down listbox next to Type on the Definition tab; the panel below changes to display
the options appropriate for the selected data type. Use the fields in the panel to define the data type.
There are five data types:
• Composite Type
• Enumeration Type
• Range Type
• External Type (or Base Type)
• Shell Type
If you select Composite in the Type field, the Definition tab displays the Composite Type panel:
Click the Add icon (+) to provide attributes of the type. Fields on the General panel are context sensitive and may be
disabled.
• Use the Member Name field to add an attribute name.
• Use the drop-down listbox in the Type field to select a datatype.
• Use the Length/Precision field to specify the maximum length of a non-numeric type, or the total count of
significant digits in a numeric type.
• Use the Scale field to specify the number of digits to the right of the decimal point.
• Use the drop-down listbox in the Collation field to select a collation (if applicable).
Click the Add icon (+) to define an additional member; click the trash icon to the left of the row to discard a row.
If you select the Enumeration in the Type field, the Definition tab displays the Enumeration Type panel:
Click the Add icon (+) to provide a label for the type.
• Use the Label field to add a label, which must be less than 64 bytes long.
Click the Add icon (+) after each selection to create additional labels; to discard a label, click the trash icon to the left
of the row.
If you select External, the Definition tab displays the External Type panel:
• Use the drop-down listbox next to the Input function field to add an input_function. The input_function con-
verts the type’s external textual representation to the internal representation used by the operators and functions
defined for the type.
• Use the drop-down listbox next to the Output function field to add an output_function. The output_function
converts the type’s internal representation used by the operators and functions defined for the type to the type’s
external textual representation.
On the Optional-1 tab:
• Use the drop-down listbox next to the optional Receive Function field to select a receive_function. The optional
receive_function converts the type’s external binary representation to the internal representation. If this function
is not supplied, the type cannot participate in binary input.
• Use the drop-down listbox next to the optional Send function field to select a send_function. The optional
send_function converts from the internal representation to the external binary representation. If this function is
not supplied, the type cannot participate in binary output.
• Use the drop-down listbox next to the optional Typmod in function field tab to select a
type_modifier_input_function.
• Use the drop-down listbox next to the optional Typmod out function field tab to select a
type_modifier_output_function. It is allowed to omit the type_modifier_output_function, in which case the
default display format is the stored typmod integer value enclosed in parentheses.
• Use the optional Internal length to specify a value for internal representation.
• Move the Variable? switch to specify the internal representation is of variable length (VARIABLE). The default
is a fixed length positive integer.
• Specify a default value in the optional Default field in cases where a column of the data type defaults to some-
thing other than the null value. Specify the default with the DEFAULT key word. (A default can be overridden
by an explicit DEFAULT clause attached to a particular column.)
• Use the drop-down listbox next to the optional Analyze function field to select a function for performing type-
specific statistics collection for columns of the data type.
• Use the drop-down listbox next to the optional Category type field to help control which implicit cast will be
applied in ambiguous situations.
• Move the Preferred? switch to Yes to specify the selected category type is preferred. The default is No.
On the Optional-2 tab:
• Use the drop-down listbox next to the optional Element type field to specify a data type.
• Use the optional Delimiter field to indicate the delimiter to be used between values in the external representation
of arrays for this data type. The default delimiter is the comma (,). Note that the delimiter is associated with the
array element type, not the array type itself.
• Use the drop-down listbox next to Alignment type to specify the storage alignment required for the data type.
The allowed values (char, int2, int4, and double) correspond with alignment on 1, 2, 4, or 8 byte boundaries.
• Use the drop-down listbox next to optional Storage type to select a strategy for storing data.
• Move the Passed by value? switch to Yes to override the existing data type value. The default is No.
• Move the Collatable? switch to Yes to specify column definitions and expressions of the type may carry collation
information through use of the COLLATE clause. The default is No.
If you select Range in the Type field, the Definition tab displays the Range panel. Fields on the Range panel are
context-sensitive and may be disabled.
• Use the drop-down listbox next to Sub-type to select an associated b-tree operator class (to determine the order-
ing of values for the range type).
• Use the drop-down listbox next to Sub-type operator class to use a non-default operator class.
• Use the drop-down listbox next to Collation to use a non-default collation in the range’s ordering if the sub-type
is collatable.
• Use the drop-down listbox next to Canonical function to convert range values to a canonical form.
• Use the drop-down listbox next to Sub-type diff function to select a user-defined subtype_diff function.
If you select Shell in the Type field, the Definition tab displays the Shell panel:
Use the Security tab to assign privileges and define security labels.
Use the Privileges panel to assign privileges for the type; click the Add icon (+) to grant privileges:
• Select the name of the role that will be granted privileges on the type 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.
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.
Use the Security Labels panel to define security labels applied to the type. Click the Add icon (+) to add each security
label selection:
• 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 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.
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.
Click the SQL tab to continue.
Your entries in the Type 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.
4.23.1 Example
The following is an example of a sql command generated by user selections made in the Type dialog:
The example shown demonstrates creating a data type named work_order. The data type is an enumerated type with
three labels: new, open and closed.
• Click the Info button (i) to access online help.
• Click the Save button to save work.
Use the User Mapping dialog to define a new mapping of a user to a foreign server.
The User Mapping dialog organizes the development of a user mapping through the following dialog tabs: General
and Options. The SQL tab displays the SQL code generated by dialog selections.
Use the drop-down listbox in the User field in the General tab to identify the connecting role:
• Select CURRENT_USER to use the name of the current role.
• Select PUBLIC if no other user-specific mapping is applicable.
• Select a pre-defined role name to specify the name of an existing user.
Click the Options tab to continue.
Use the fields in the Options tab to specify connection options; the accepted option names and values are specific to
the foreign data wrapper associated with the server specified in the user mapping. Click the Add button to add an
option/value pair.
• Specify the option name in the Option field.
• Provide a corresponding value in the Value field.
Click Add to specify each additional option/value pair; to discard an option, 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 User Mapping 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.
4.24.1 Example
The following is an example of the sql command generated by user selections in the User Mapping dialog:
The example shown demonstrates a user mapping for the hdfs_server. The user is CURRENT_USER with a password
secret.
• Click the Info button (i) to access online help.
• Click the Save button to save work.
• Click the Cancel button to exit without saving work.
• Click the Reset button to restore configuration parameters.
Use the View dialog to define a view. The view is not physically materialized; the query is executed each time the view
is referenced in a query.
The View dialog organizes the development of a View through the following dialog tabs: General, Definition, Code
and Security”. The SQL tab displays the SQL code generated by dialog selections.
Click the General tab to begin.
Use the fields in the Definition tab to define properties of the view:
• Set the Security Barrier switch to Yes to indicate that the view is to act as a security barrier. For more information
about defining and using a security barrier rule, see Section 38.5 of the PostgreSQL documentation.
• Use the drop-down listbox next to Check options to select from No, Local or Cascaded:
– The Local option specifies that new rows are only checked against the conditions defined in the view. Any
conditions defined on underlying base views are not checked (unless you specify the CHECK OPTION).
– The Cascaded option specifies new rows are checked against the conditions of the view and all underlying
base views.
Click the Code tab to continue.
Use the workspace in the Code tab to write a query to create a view.
Click the Security tab to continue.
Use the Security tab to assign privileges and define security labels.
Use the Privileges panel to assign privileges to a role. Click the Add icon (+) to set privileges for the view:
• Select the name of the role that will be granted privileges 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.
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.
Use the Security Labels panel to define security labels applied to the view. Click the Add icon (+) to add each security
label selection:
• 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.
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.
Click the SQL tab to continue.
Your entries in the View 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.
4.25.1 Example
The following is an example of the sql command generated by user selections in the View dialog:
pgAdmin 4 provides dialogs that allow you to modify all table properties and attributes.
To access a dialog that allows you to create a database object, right-click on the object type in the pgAdmin tree
control, and select the Create option for that object. For example, to create a new database, right-click on the Casts
node, and select Create Cast. . .
Use the Check dialog to define or modify a check constraint. A check constraint specifies an expression that produces
a Boolean result that new or updated rows must satisfy for an insert or update operation to succeed.
The Check dialog organizes the development of a check constraint through the General and Definition tabs. The SQL
tab displays the SQL code generated by dialog selections.
197
pgAdmin 4 Documentation, Release 4.25
Use the fields in the General tab to identify the check constraint:
• Use the Name field to provide a descriptive name for the check constraint that will be displayed in the pgAdmin
tree control. With PostgreSQL 9.5 forward, when a table has multiple check constraints, they will be tested for
each row in alphabetical order by name and after NOT NULL constraints.
• Store notes about the check constraint in the Comment field.
Click the Definition tab to continue.
Use the fields in the Definition tab to define the check constraint:
• Provide the expression that a row must satisfy in the Check field.
• Move the No Inherit? switch to the Yes position to specify that this constraint is not automatically inherited by
a table’s children. The default is No, meaning that the constraint will be inherited by any children.
• Move the Don’t validate? switch to the No position to skip validation of existing data; the constraint may not
hold for all rows in the table. The default is Yes.
Click the SQL tab to continue.
Your entries in the Check 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 Check dialog:
The example shown demonstrates creating a check constraint named check_price on the price column of the products
table. The constraint confirms that any values added to the column are greater than 0.
• Click the Info button (i) to access online help.
• Click the Save button to save work.
• Click the Cancel button to exit without saving work.
• Click the Reset button to restore configuration parameters.
Use the Column dialog to add a column to an existing table or modify a column definition.
The Column dialog organizes the development of a column through the following dialog tabs: General, Definition,
and Security. The SQL tab displays the SQL code generated by dialog selections.
Use the fields in the Definition tab to add parameters for the column. (Fields are disabled if inapplicable.)
• Use the drop-down listbox next to Data Type to select a data type for the column. For more information on the
data types that are supported by PostgreSQL, refer to Chapter 8 of the Postgres core documentation. This field
is required.
• Use the Length/Precision and Scale fields to specify the maximum number of significant digits in a numeric
value, or the maximum number of characters in a text value.
• Use the drop-down listbox next to Collation to apply a collation setting to the column.
Click the Constraints tab to continue.
Use the fields in the Constraints tab to specify constraints for the column. (Fields are disabled if inapplicable.)
• Use the Default Value field to specify a default data value.
• Move the Not Null switch to the Yes position to specify the column may not contain null values. The default is
No.
• Use the Type field to specify the column type (NONE/IDENTITY/GENERATED). The default is NONE.
Click the IDENTITY type to create Identity column.
Use the following fields to create IDENTITY column. Identity columns are applicable for PG/EPAS version 10 and
above.
• Use the Identity field to specify ALWAYS or BY DEFAULT. This clause is used to determine how the sequence
value is given precedence over a user-specified value in an INSERT statement.
• Use the Increment field to specify which value is added to the current sequence value to create a new value.
• Provide a value in the Start field to specify the beginning value of the sequence. The default starting value is
MINVALUE for ascending sequences and MAXVALUE for descending ones.
• Provide a value in the Minimum field to specify the minimum value a sequence can generate. If this clause is not
supplied or NO MINVALUE is specified, then defaults will be used. The defaults are 1 and -263-1 for ascending
and descending sequences, respectively.
• Provide a value in the Maximum field to specify the maximum value for the sequence. If this clause is not
supplied or NO MAXVALUE is specified, then default values will be used. The defaults are 263-1 and -1 for
ascending and descending sequences, respectively.
• Provide a value in the Cache field to specify how many sequence numbers are to be preallocated and stored in
memory for faster access. The minimum value is 1 (only one value can be generated at a time, i.e., no cache),
and this is also the default.
• Move the Cycled switch to the Yes position to allow the sequence to wrap around when the MAXVALUE or the
MINVALUE has been reached by an ascending or descending sequence respectively. If the limit is reached, the
next number generated will be the MINVALUE or MAXVALUE, respectively. The default is No.
Click the GENERATED type to create Generated column.
Use the following fields to create GENERATED column. Generated columns are applicable for PG/EPAS version 12
and above.
• Use the Expression field to specify the generation expression. It can refer to other columns in the table, but not
other generated columns. Any functions and operators used must be immutable. References to other tables are
not allowed.
Click the Variables tab to continue.
Use the Variables tab to to specify the number of distinct values that may be present in the column; this value overrides
estimates made by the ANALYZE command. Click the Add icon (+) to add a Name/Value pair:
• Select the name of the variable from the drop-down listbox in the Name field.
– Select n_distinct to specify the number of distinct values for the column.
– Select n_distinct_inherited to specify the number of distinct values for the table and its children.
• Specify the number of distinct values in the Value field. For more information, see the documentation for ALTER
TABLE.
Click the Add icon (+) to specify each additional Name/Value pair; to discard a variable, click the trash icon to the left
of the row and confirm deletion in the Delete Row popup.
Click the Security tab to continue.
Use the Security tab to assign attributes and define security labels. Click the Add icon (+) to add each security label
selection:
• 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.
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.
Click the SQL tab to continue.
Your entries in the Column 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.
5.2.1 Example
The following is an example of the sql command generated by user selections in the Column dialog:
The example shown demonstrates creating a column named territory in the table named distributors.
• Click the Info button (i) to access online help.
• Click the Save button to save work.
• Click the Cancel button to exit without saving work.
• Click the Reset button to restore configuration parameters.
Use the Compound Trigger dialog to create a compound trigger or modify an existing compound trigger. Compound
Trigger is supported only for EPAS server 12 and above. A compound trigger executes a specified code when certain
events occur.
The Compound Trigger dialog organizes the development of a compound trigger through the following dialog tabs:
General, Events, and Code. The SQL tab displays the SQL code generated by dialog selections.
Use the fields in the General tab to identify the compound trigger:
• Use the Name field to add a descriptive name for the compound trigger. This must be distinct from the name of
any other compound trigger for the same table. The name will be displayed in the pgAdmin tree control.
• Store notes about the compound trigger in the Comment field.
• Trigger enabled field is available in compound trigger dialog once the trigger is created. You can select one of
Use the fields in the Events tab to specify how and when the compound trigger fires:
• Select the type of event(s) that will invoke the compound trigger; to select an event type, move the switch next
to the event to the YES position. The supported event types are INSERT, UPDATE, DELETE and TRUNCATE.
Views cannot have TRUNCATE triggers.
• Use the When field to provide a boolean condition that will invoke the compound trigger.
• If defining a column-specific compound trigger, use the Columns field to specify the columns or columns that
are the target of the compound trigger.
Click the Code tab to continue.
Use the Code field to specify the code for the five timing events BEFORE STATEMENT, AFTER STATEMENT, BE-
FORE EACH ROW, AFTER EACH ROW, INSTEAD OF EACH ROW that will be invoked when the compound trigger
fires. Basic template is provided with place holders.
Click the SQL tab to continue.
Your entries in the Compound Trigger 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.
5.3.1 Example
The following is an example of the sql command generated by user selections in the Compound Trigger dialog:
Use the Exclusion constraint dialog to define or modify the behavior of an exclusion constraint. An exclusion con-
straint guarantees that if any two rows are compared on the specified column or expression (using the specified opera-
tor), at least one of the operator comparisons will return false or null.
The Exclusion constraint dialog organizes the development of an exclusion constraint through the following dialog
tabs: General, Definition, and Columns. The SQL tab displays the SQL code generated by dialog selections.
Use the fields in the General tab to identify the exclusion constraint:
• Use the Name field to provide a descriptive name for the exclusion constraint. The name will be displayed in
the pgAdmin tree control.
Click the Definition tab to continue.
Use the fields in the Definition tab to define the exclusion constraint:
• Use the drop-down listbox next to Tablespace to select the tablespace in which the index associated with the
exclude constraint will reside.
• Use the drop-down listbox next to Access method to specify the type of index that will be used when imple-
menting the exclusion constraint:
– Select gist to specify a GiST index.
– Select spgist to specify a space-partitioned GiST index.
– Select btree to specify a B-tree index.
– Select hash to specify a hash index.
• Use the Fill Factor field to specify a fill factor for the table and associated index. The fill factor is a percentage
between 10 and 100. 100 (complete packing) is the default.
• Move the Deferrable? switch to the Yes position to specify that the timing of the constraint is deferrable, and
can be postponed until the end of the statement. The default is No.
• If enabled, move the Deferred? switch to the Yes position to specify the timing of the constraint is deferred to
the end of the statement. The default is No.
• Use the Constraint field to provide a condition that a row must satisfy to be included in the table.
Click the Columns tab to continue.
Use the fields in the Columns tab to to specify the column(s) to which the constraint applies. Use the drop-down
listbox next to Column to select a column and click the Add icon (+) to provide details of the action on the column:
• The Column field is populated with the selection made in the Column drop-down listbox.
• If applicable, use the drop-down listbox in the Operator class to specify the operator class that will be used by
the index for the column.
• Move the DESC switch to DESC to specify a descending sort order. The default is ASC which specifies an
ascending sort order.
• Use the NULLs order column to specify the placement of NULL values (when sorted). Specify FIRST or LAST.
• Use the drop-down list next to Operator to specify a comparison or conditional operator.
Use Include columns field to specify columns for INCLUDE clause of the constraint. This option is available in
Postgres 11 and later.
Click the SQL tab to continue.
Your entries in the Exclusion Constraint 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.
5.4.1 Example
The following is an example of the sql command generated by user selections in the Exclusion Constraint dialog:
The example shown demonstrates creating an exclusion constraint named exclude_department that restricts additions
to the dept table to those additions that are not equal to the value of the deptno column. The constraint uses a btree
index.
• Click the Info button (i) to access online help.
• Click the Save button to save work.
• Click the Cancel button to exit without saving work.
• Click the Reset button to restore configuration parameters.
Use the Foreign key dialog to specify the behavior of a foreign key constraint. A foreign key constraint maintains
referential integrity between two tables. A foreign key constraint cannot be defined between a temporary table and a
permanent table.
The Foreign key dialog organizes the development of a foreign key constraint through the following dialog tabs:
General, Definition, Columns, and Action. The SQL tab displays the SQL code generated by dialog selections.
Use the fields in the General tab to identify the foreign key constraint:
• Use the Name field to add a descriptive name for the foreign key. The name will be displayed in the pgAdmin
tree control.
• Store notes about the foreign key constraint in the Comment field.
Click the Definition tab to continue.
Use the fields in the Definition tab to define the foreign key constraint:
• Move the Deferrable? switch to the Yes position to specify the timing of the constraint is deferrable and can be
postponed until the end of the statement. The default is No.
• If enabled, move the Deferred? switch to the Yes position to specify the timing of the constraint is deferred to
the end of the statement. The default is No.
• Move the Match type switch specify the type of matching that is enforced by the constraint:
– Select Full to indicate that all columns of a multicolumn foreign key must be null if any column is null; if
all columns are null, the row is not required to have a match in the referenced table.
– Select Simple to specify that a single foreign key column may be null; if any column is null, the row is not
required to have a match in the referenced table.
• Move the Validated switch to the Yes position to instruct the server to validate the existing table content (against
a foreign key or check constraint) when you save modifications to this dialog.
• Move the Auto FK Index switch to the No position to disable the automatic index feature.
• The field next to Covering Index generates the name of an index if the Auto FK Index switch is in the Yes
position; or, this field is disabled.
Click the Columns tab to continue.
Use the fields in the Columns tab to specify one or more reference column(s). A Foreign Key constraint requires that
one or more columns of a table must only contain values that match values in the referenced column(s) of a row of a
referenced table:
• Use the drop-down listbox next to Local column to specify the column in the current table that will be compared
to the foreign table.
• Use the drop-down listbox next to References to specify the name of the table in which the comparison column(s)
resides.
• Use the drop-down listbox next to Referencing to specify a column in the foreign table.
Click the Add icon (+) to add a column to the list; repeat the steps above and click the Add icon (+) to add additional
columns. To discard an entry, click the trash icon to the left of the entry and confirm deletion in the Delete Row popup.
Click the Action tab to continue.
Use the drop-down listboxes on the Action tab to specify behavior related to the foreign key constraint that will be
performed when data within the table is updated or deleted:
• Use the drop-down listbox next to On update to select an action that will be performed when data in the table is
updated.
• Use the drop-down listbox next to On delete to select an action that will be performed when data in the table is
deleted.
The supported actions are:
NO Produce an error indicating that the deletion or update will create a foreign key constraint violation. If
AC- the constraint is deferred, this error will be produced at constraint check time if any referencing rows still
TION exist. This is the default.
RE- Throw an error indicating that the deletion or update would create a foreign key constraint violation. This
STRICT is the same as NO ACTION except that the check is not deferrable.
CAS- Delete any rows referencing the deleted row, or update the values of the referencing column(s) to the new
CADE values of the referenced columns, respectively.
SET Set the referencing column(s) to null.
NULL
SET Set the referencing column(s) to their default values. There must be a row in the referenced table that
DE- matches the default values (if they are not null), or the operation will fail.
FAULT
5.5.1 Example
The following is an example of the sql command generated by user selections in the Foreign key dialog:
The example shown demonstrates creating a foreign key constraint named territory_fkey that matches values in the
distributors table territory column with those of the sales_territories table region column.
• Click the Info button (i) to access online help.
• Click the Save button to save work.
• Click the Cancel button to exit without saving work.
• Click the Reset button to restore configuration parameters.
Use the Index dialog to create an index on a specified table or materialized view.
The Index dialog organizes the development of a index through the following dialog tabs: General and Definition. The
SQL tab displays the SQL code generated by dialog selections.
5.6.1 Example
The following is an example of the sql command generated by user selections in the Index dialog:
The example shown demonstrates creating an index named dist_codes that indexes the values in the code column of
the distributors table.
• Click the Info button (i) to access online help.
• Click the Save button to save work.
• Click the Cancel button to exit without saving work.
• Click the Reset button to restore configuration parameters.
Use the Primary key dialog to create or modify a primary key constraint. A primary key constraint indicates that a
column, or group of columns, uniquely identifies rows in a table. This requires that the values in the selected column(s)
be both unique and not null.
The Primary key dialog organizes the development of a primary key constraint through the General and Definition
tabs. The SQL tab displays the SQL code generated by dialog selections.
Use the fields in the General tab to identify the primary key:
• Use the Name field to add a descriptive name for the primary key constraint. The name will be displayed in the
pgAdmin tree control.
Click the Definition tab to continue.
Use the fields in the Definition tab to define the primary key constraint:
• Click inside the Columns field and select one or more column names from the drop-down listbox. To delete a
selection, click the x to the left of the column name. The primary key constraint should be different from any
unique constraint defined for the same table; the selected column(s) for the constraints must be distinct.
• Use Include columns field to specify columns for INCLUDE clause of the index. This option is available in
Postgres 11 and later.
• Select the name of the tablespace in which the primary key constraint will reside from the drop-down listbox in
the Tablespace field.
• Select the name of an index from the drop-down listbox in the Index field. This field is optional. Adding a
primary key will automatically create a unique B-tree index on the column or group of columns listed in the
primary key, and will force the column(s) to be marked NOT NULL.
• Use the Fill Factor field to specify a fill factor for the table and index. The fill factor for a table is a percentage
between 10 and 100. 100 (complete packing) is the default.
• Move the Deferrable? switch to the Yes position to specify the timing of the constraint is deferrable and can be
postponed until the end of the statement. The default is No.
• If enabled, move the Deferred? switch to the Yes position to specify the timing of the constraint is deferred to
the end of the statement. The default is No.
Click the SQL tab to continue.
Your entries in the Primary key 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.
5.7.1 Example
The following is an example of the sql command generated by user selections in the Primary key dialog:
The example shown demonstrates creating a primary key constraint named dept_pkey on the dept_id column of the
dept table.
Use the RLS Policy dialog to Create a Row Level Security Policy.
Note: If the Row Level Security is enabled at table level and no policy is created then by default Deny Policy is
applied. That means, no rows are visible or can be modified for that table.
The RLS Policy dialog creates a Row Level Security Policy through the following dialog tabs: General, and Com-
mands. The SQL tab displays the SQL code generated by dialog selections.
Use the fields in the General tab to define the RLS Policy:
• Use the Name field to add a descriptive name for the RLS Policy. The name will be displayed in the pgAdmin
tree control.
• Use the drop-down listbox next to Role to select the Role to which the RLS Policy is to be applied.
• Use the drop-down listbox next to Type to select the type of the policy.
Click the Commands tab to continue.
Use the fields in the Commands tab to define the RLS Policy:
• Use the drop-down listbox next to Event to select the command to which policy applies. Valid options are ALL,
SELECT, INSERT, UPDATE, and DELETE. Default is ALL.
• Use the Using field to add a SQL conditional expression returning boolean. This expression will be added to
queries that refer to the table if row level security is enabled.
• Use the With check field to add a SQL conditional expression returning boolean. This expression will be used in
INSERT and UPDATE queries against the table if row level security is enabled.
Click the SQL tab to continue.
Your entries in the RLS Policy 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.
5.8.1 Example
The following is an example of the sql command generated by user selections in the RLS Policy dialog:
The example shown demonstrates creating a RLS Policy named account_managers that applies the Row Level Security
on the accounts table.
• Click the Info button (i) to access online help.
• Click the Save button to save work.
• Click the Cancel button to exit without saving work.
• Click the Reset button to restore configuration parameters.
Use the Rule dialog to define or modify a rule for a specified table or view. A PostgreSQL rule allows you to define
an additional action that will be performed when a SELECT, INSERT, UPDATE, or DELETE is performed against a
table.
The Rule dialog organizes the development of a rule through the General, Definition, Condition, Commands tabs. The
SQL tab displays the SQL code generated by dialog selections.
Specify a SQL conditional expression that returns a boolean value in the editor.
Click the Commands tab to continue.
Provide a command in the editor that defines the action performed by the rule.
Click the SQL tab to continue.
Your entries in the Rule dialog generate a SQL command (see an example below). Use the SQL tab for review; revisit
5.9.1 Example
The following is an example of the sql command generated by user selections in the Rule dialog:
Use the drop-down listbox next to Inherited from table(s) to specify any parent table(s); the table will inherit columns
from the selected parent table(s). Click inside the Inherited from table(s) field to select a table name from a drop-down
list. Repeat to add any other parent tables. Delete a selected table by clicking the x to the left of the parent name. Note
that inherited column names and datatypes are not editable in the current dialog; they must be modified at the parent
level.
Click the Add icon (+) to specify the names of columns and their datatypes in the Columns table:
• Use the Name field to add a descriptive name for the column.
• Use the drop-down listbox in the Data type field to select a data type for the column. This can include array
specifiers. For more information on the data types supported by PostgreSQL, refer to Chapter 8 of the core
documentation.
• If enabled, use the Length/Precision and Scale fields to specify the maximum number of significant digits in a
numeric value, or the maximum number of characters in a text value.
• Move the Not NULL? switch to the Yes position to require a value in the column field.
• Move the Primary key? switch to the Yes position to specify the column is the primary key constraint.
Click the Add icon (+) to add additional columns; to discard a column, click the trash icon to the left of the row and
confirm deletion in the Delete Row popup.
Click the Constraints tab to continue.
Use the fields in the Constraints tab to provide a table or column constraint. Optional constraint clauses specify
constraints (tests) that new or updated rows must satisfy for an INSERT or UPDATE operation to succeed. Select the
appropriate constraint type by selecting one of the following tabs on the Constraints panel:
To add a primary key for the table, select the Primary Key tab, and click the Add icon (+). To define the primary key,
click the Edit icon to the left of the Trash icon. A dialog similar to the Primary key dialog (accessed by right clicking
on Constraints in the pgAdmin tree control) opens.
Use the fields in the General tab to identify the primary key:
• Use the Name field to add a descriptive name for the primary key constraint. The name will be displayed in the
pgAdmin tree control.
• Provide notes about the primary key in the Comment field.
Click the Definition tab to continue.
Use the fields in the Definition tab to define the primary key constraint:
• Click inside the Columns field and select one or more column names from the drop-down listbox. To delete a
selection, click the x to the left of the column name. The primary key constraint should be different from any
unique constraint defined for the same table; the selected column(s) for the constraints must be distinct.
• Select the name of the tablespace in which the primary key constraint will reside from the drop-down listbox in
the Tablespace field.
• Use the Fill Factor field to specify a fill factor for the table and index. The fill factor for a table is a percentage
between 10 and 100. 100 (complete packing) is the default.
• Move the Deferrable? switch to the Yes position to specify the timing of the constraint is deferrable and can be
postponed until the end of the statement. The default is No.
• If enabled, move the Deferred? switch to the Yes position to specify the timing of the constraint is deferred to
the end of the statement. The default is No.
To add a foreign key constraint, select the Foreign Key tab, and click the Add icon (+). To define the constraint, click
the Edit icon to the left of the Trash icon. A dialog similar to the Foreign key dialog (accessed by right clicking on
Constraints in the pgAdmin tree control) opens.
Use the fields in the General tab to identify the foreign key constraint:
• Use the Name field to add a descriptive name for the foreign key constraint. The name will be displayed in the
pgAdmin tree control.
• Provide notes about the foreign key in the Comment field.
Click the Definition tab to continue.
Use the fields in the Definition tab to define the foreign key constraint:
• Move the Deferrable? switch to the Yes position to specify the timing of the constraint is deferrable and can be
postponed until the end of the statement. The default is No.
• If enabled, move the Deferred? switch to the Yes position to specify the timing of the constraint is deferred to
the end of the statement. The default is No.
• Move the Match type switch specify the type of matching that is enforced by the constraint:
– Select Full to indicate that all columns of a multicolumn foreign key must be null if any column is null; if
all columns are null, the row is not required to have a match in the referenced table.
– Select Simple to specify that a single foreign key column may be null; if any column is null, the row is not
required to have a match in the referenced table.
• Move the Validated switch to the Yes position to instruct the server to validate the existing table content (against
a foreign key or check constraint) when you save modifications to this dialog.
• Move the Auto FK Index switch to the No position to disable the automatic index feature.
• The field next to Covering Index generates the name of an index if the Auto FK Index switch is in the Yes
position; or, this field is disabled.
Click the Columns tab to continue.
Use the fields in the Columns tab to specify one or more reference column(s). A Foreign Key constraint requires
that one or more columns of a table must only contain values that match values in the referenced column(s) of a
row of a referenced table:
• Use the drop-down listbox next to Local column to specify the column in the current table that will be compared
to the foreign table.
• Use the drop-down listbox next to References to specify the name of the table in which the comparison column(s)
resides.
• Use the drop-down listbox next to Referencing to specify a column in the foreign table.
Click the Add icon (+) to add a column to the list; repeat the steps above and click the Add icon (+) to add additional
columns. To discard an entry, click the trash icon to the left of the entry and confirm deletion in the Delete Row popup.
Click the Action tab to continue.
Use the drop-down listboxes on the Action tab to specify behavior related to the foreign key constraint that will be
performed when data within the table is updated or deleted:
• Use the drop-down listbox next to On update to select an action that will be performed when data in the table is
updated.
• Use the drop-down listbox next to On delete to select an action that will be performed when data in the table is
deleted.
The supported actions are:
NO ACTION Produce an error indicating that the deletion or update will create a foreign key constraint
violation. If the constraint is deferred, this error will be produced at constraint check time
if any referencing rows still exist. This is the default.
RESTRICT Throw an error indicating that the deletion or update would create a foreign key constraint
violation. This is the same as NO ACTION except that the check is not deferrable.
CASCADE Delete any rows referencing the deleted row, or update the values of the referencing col-
umn(s) to the new values of the referenced columns, respectively.
SET NULL Set the referencing column(s) to null.
SET DEFAULT Set the referencing column(s) to their default values. There must be a row in the referenced
table that matches the default values (if they are not null), or the operation will fail.
To add a check constraint, select the Check tab on the panel, and click the Add icon (+). To define the check constraint,
click the Edit icon to the left of the Trash icon. A dialog similar to the Check dialog (accessed by right clicking on
Constraints in the pgAdmin tree control) opens.
Use the fields in the General tab to identify the check constraint:
• Use the Name field to add a descriptive name for the check constraint. The name will be displayed in the
pgAdmin tree control. With PostgreSQL 9.5 forward, when a table has multiple check constraints, they will be
tested for each row in alphabetical order by name and after NOT NULL constraints.
• Provide notes about the check constraint in the Comment field.
Click the Definition tab to continue.
Use the fields in the Definition tab to define the check constraint:
• Provide the expression that a row must satisfy in the Check field. This field is required.
• Move the No Inherit? switch to the Yes position to specify that this constraint is not automatically inherited by
a table’s children. The default is No, meaning that the constraint will be inherited by any children.
• Move the Don’t validate? switch to the No position to skip validation of existing data; the constraint may not
hold for all rows in the table. The default is Yes.
To add a unique constraint, select the Unique tab on the panel, and click the Add icon (+). To define the constraint,
click the Edit icon to the left of the Trash icon. A dialog similar to the Unique constraint dialog (accessed by right
clicking on Constraints in the pgAdmin tree control) opens.
Use the fields in the General tab to identify the unique constraint:
• Use the Name field to add a descriptive name for the unique constraint. The name will be displayed in the
pgAdmin tree control.
• Provide notes about the unique constraint in the Comment field.
Click the Definition tab to continue.
Use the fields in the Definition tab to define the unique constraint:
• Click inside the Columns field and select one or more column names from the drop-down listbox. To delete a
selection, click the x to the left of the column name. The unique constraint should be different from the primary
key constraint defined for the same table; the selected column(s) for the constraints must be distinct.
• Select the name of the tablespace in which the unique constraint will reside from the drop-down listbox in the
Tablespace field.
• Use the Fill Factor field to specify a fill factor for the table and index. The fill factor for a table is a percentage
between 10 and 100. 100 (complete packing) is the default.
• Move the Deferrable? switch to the Yes position to specify the timing of the constraint is deferrable and can be
postponed until the end of the statement. The default is No.
• If enabled, move the Deferred? switch to the Yes position to specify the timing of the constraint is deferred to
the end of the statement. The default is No.
To add an exclusion constraint, select the Exclude tab on the panel, and click the Add icon (+). To define the constraint,
click the Edit icon to the left of the Trash icon. A dialog similar to the Exclusion constraint dialog (accessed by right
clicking on Constraints in the pgAdmin tree control) opens.
Use the fields in the General tab to identify the exclusion constraint:
• Use the Name field to provide a descriptive name for the exclusion constraint. The name will be displayed in
the pgAdmin tree control.
• Provide notes about the exclusion constraint in the Comment field.
Click the Definition tab to continue.
Use the fields in the Definition tab to define the exclusion constraint:
• Use the drop-down listbox next to Tablespace to select the tablespace in which the index associated with the
exclude constraint will reside.
• Use the drop-down listbox next to Access method to specify the type of index that will be used when imple-
menting the exclusion constraint:
– Select gist to specify a GiST index (the default).
– Select spgist to specify a space-partitioned GiST index.
– Select btree to specify a B-tree index.
– Select hash to specify a hash index.
• Use the Fill Factor field to specify a fill factor for the table and associated index. The fill factor is a percentage
between 10 and 100. 100 (complete packing) is the default.
• Move the Deferrable? switch to the Yes position to specify that the timing of the constraint is deferrable, and
can be postponed until the end of the statement. The default is No.
• If enabled, move the Deferred? switch to the Yes position to specify the timing of the constraint is deferred to
the end of the statement. The default is No.
• Use the Constraint field to provide a condition that a row must satisfy to be included in the table.
Click the Columns tab to continue.
Use the fields in the Columns tab to to specify the column(s) to which the constraint applies. Use the drop-down
listbox next to Column to select a column and click the Add icon (+) to provide details of the action on the column:
• The Column field is populated with the selection made in the Column drop-down listbox.
• If applicable, use the drop-down listbox in the Operator class to specify the operator class that will be used by
the index for the column.
• Move the DESC switch to DESC to specify a descending sort order. The default is ASC which specifies an
ascending sort order.
• Move the NULLs order switch to LAST to define an ascending sort order for NULLs. The default is FIRST
which specifies a descending order.
• Use the drop-down list next to Operator to specify a comparison or conditional operator.
Click the Advanced tab to continue.
Use the fields in the Advanced tab to define advanced features for the table:
• Move the RLS Policy? switch to the Yes position to enable the Row Level Security.
• Move the Force RLS Policy? to the Yes position to force the policy on the owner of the table.
• Use the drop-down listbox next to Of type to copy the table structure from the specified composite type. Please
note that a typed table will be dropped if the type is dropped (with DROP TYPE . . . CASCADE).
• Use the Fill Factor field to specify a fill factor for the table. The fill factor for a table is a percentage between
10 and 100. 100 (complete packing) is the default.
• Use the Toast tuple target field to set toast_tuple_target storage parameter of the table. The toast_tuple_target
value is in bytes and has minimum value of 128. This field will be enabled only for PostgreSQL version >= 11
• Use the Parallel workers field to set parallel_workers storage parameter of the table. The parallel_workers sets
the number of workers that should be used to assist a parallel scan of the table. This field will be enabled only
for PostgreSQL version >= 9.6
• Move the Has OIDs? switch to the Yes position to specify that each row within a table has a system-assigned
object identifier. The default is No.
• Move the Unlogged? switch to the Yes position to disable logging for the table. Data written to an unlogged
table is not written to the write-ahead log. Any indexes created on an unlogged table are automatically unlogged
as well. The default is No.
Use the fields in the Like box to specify which attributes of an existing table from which a table will automatically
copy column names, data types, and not-null constraints; after saving the new or modified table, any changes to the
Use the fields in the partition tab to create the partitions for the table:
• Select a partition type from the Partition Type selection box. There are 3 options available; Range, List and
Hash. Hash option will only enable for PostgreSQL version >= 11.
Use the Partition Keys panel to define the partition keys. Click the Add icon (+) to add each partition keys selection:
• Select a partition key type in the Keytype field.
• Select a partition column in the Column field if Column option selected for Keytype field .
• Specify the expression in the Expression field if Expression option selected for the Keytype field.
Use the Partitions panel to define the partitions of a table. Click the Add icon (+) to add each partition:
• Move the Operation switch to attach to attach the partition, by default it is create.
• Use the Name field to add the name of the partition.
• If partition type is Range or List then Default field will be enabled.
• If partition type is Range then From and To fields will be enabled.
• If partition type is List then In field will be enabled.
• If partition type is Hash then Modulus and Remainder fields will be enabled.
Users can create a partition and define them as a partitioned table. Click the Edit icon to expand the properties of a
partition. Use the Partition tab to create that partition as a partitioned table.
• Move the Partitioned Table? switch to the Yes in case you want to create a partitioned table.
• Select a partition type from the Partition Type selection box.
• Use the Partition Keys panel to define the partition keys.
View of multi level Partitioned Table in browser tree:
Use the tabs nested inside the Parameter tab to specify VACUUM and ANALYZE thresholds; use the Table tab and
the Toast Table tab to customize values for the table and the associated toast table:
• Move the Custom auto-vacuum? switch to the Yes position to perform custom maintenance on the table and to
select values in the Vacuum table. The Vacuum Table provides default values for maintenance operations.
• Changing Autovacuum enabled? to Not set will reset autovacuum_enabled.
Provide a custom value in the Value column for each metric listed in the Label column.
Click the Security tab to continue.
Use the Security tab to assign privileges and define security labels.
Use the Privileges panel to assign privileges to a role. Click the Add icon (+) to set privileges for database objects:
• 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.
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.
Use the Security Labels panel to define security labels applied to the function. Click the Add icon (+) to add each
security label selection:
• 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.
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.
Click the SQL tab to continue.
Your entries in the Table 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.
5.10.1 Example
The following is an example of the sql command generated by user selections in the Table dialog:
The example shown demonstrates creating a table named product_category. It has three columns and a primary key
constraint on the category_id column.
• Click the Info button (i) to access online help.
• Click the Save button to save work.
• Click the Cancel button to exit without saving work.
• Click the Reset button to restore configuration parameters.
Use the Trigger dialog to create a trigger or modify an existing trigger. A trigger executes a specified function when
certain events occur.
The Trigger dialog organizes the development of a trigger through the following dialog tabs: General, Definition,
Events, and Code. The SQL tab displays the SQL code generated by dialog selections.
• Trigger enabled field is available in trigger dialog once the trigger is created. You can select one of the four
options available.
Click the Events tab to continue.
Use the fields in the Events tab to specify how and when the trigger fires:
• Use the drop-down listbox next to the Fires fields to determine if the trigger fires BEFORE or AFTER a specified
event. The default is BEFORE.
• Select the type of event(s) that will invoke the trigger; to select an event type, move the switch next to the event
to the YES position. The supported event types are INSERT, UPDATE, DELETE, and TRUNCATE.
• Use the When field to provide a boolean condition that will invoke the trigger.
• If defining a column-specific trigger, use the Columns field to specify the columns or columns that are the target
of the trigger.
Click the Code tab to continue.
Use the Code field to specify any additional code that will be invoked when the trigger fires.
Click the SQL tab to continue.
Your entries in the Trigger 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.
5.11.1 Example
The following is an example of the sql command generated by user selections in the Trigger dialog:
Use the Unique constraint dialog to define a unique constraint for a specified table. Unique constraints ensure that the
data contained in a column, or a group of columns, is unique among all the rows in the table.
The Unique constraint dialog organizes the development of a unique constraint through the following dialog tabs:
General and Definition. The SQL tab displays the SQL code generated by dialog selections.
Use the fields in the General tab to identify the unique constraint:
• Use the Name field to add a descriptive name for the unique constraint. The name will be displayed in the
pgAdmin tree control.
Click the Definition tab to continue.
Use the fields in the Definition tab to define the unique constraint:
• Click inside the Columns field and select one or more column names from the drop-down listbox. To delete a
selection, click the x to the left of the column name. The unique constraint should be different from the primary
key constraint defined for the same table; the selected column(s) for the constraints must be distinct.
• Use Include columns field to specify columns for INCLUDE clause of the constraint. This option is available in
Postgres 11 and later.
• Select the name of the tablespace in which the unique constraint will reside from the drop-down listbox in the
Tablespace field.
• Select the name of an index from the drop-down listbox in the Index field. This field is optional. Adding a
unique constraint will automatically create a unique B-tree index on the column or group of columns listed in
the constraint, and will force the column(s) to be marked NOT NULL.
• Use the Fill Factor field to specify a fill factor for the table and index. The fill factor for a table is a percentage
between 10 and 100. 100 (complete packing) is the default.
• Move the Deferrable? switch to the Yes position to specify the timing of the constraint is deferrable and can be
postponed until the end of the statement. The default is No.
• If enabled, move the Deferred? switch to the Yes position to specify the timing of the constraint is deferred to
the end of the statement. The default is No.
Click the SQL tab to continue.
Your entries in the Unique constraint 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.
5.12.1 Example
The following is an example of the sql command generated by user selections in the Unique constraint dialog:
The example shown demonstrates creating a unique constraint named name_con on the name column of the distribu-
tors table.
Management Basics
pgAdmin provides point and click dialogs that help you perform server management functions. Dialogs simplify
tasks such as managing named restore points, granting user privileges, and performing VACUUM, ANALYZE and
REINDEX functions.
Use the Add named restore point dialog to take a named snapshot of the state of the server for use in a recovery file. To
create a named restore point, the server’s postgresql.conf file must specify a wal_level value of archive, hot_standby,
or logical. You must be a database superuser to create a restore point.
When the Restore point name window launches, use the field Enter the name of the restore point to add to provide a
descriptive name for the restore point.
For more information about using a restore point as a recovery target, please see the PostgreSQL documentation.
• Click the OK button to save the restore point.
• Click the Cancel button to exit without saving work.
259
pgAdmin 4 Documentation, Release 4.25
It is a good policy to routinely change your password to protect data, even in what you may consider a ‘safe’ environ-
ment. In the workplace, failure to apply an appropriate password policy could leave you in breach of Data Protection
laws.
Please consider the following guidelines when selecting a password:
• Ensure that your password is an adequate length; 6 characters should be the absolute minimum number of
characters in the password.
• Ensure that your password is not open to dictionary attacks. Use a mixture of upper and lower case letters and
numerics, and avoid words or names. Consider using the first letter from each word in a phrase that you will
remember easily but is an unfamiliar acronym.
• Ensure that your password is changed regularly; at minimum, change it every ninety days.
The guidelines above should be considered a starting point: They are not a comprehensive list and they will not
guarantee security.
The Grant Wizard tool is a graphical interface that allows you to manage the privileges of one or more database objects
in a point-and-click environment. A search box, dropdown lists, and checkboxes facilitate quick selections of database
objects, roles and privileges.
The wizard organizes privilege management through a sequence of windows: Object Selection (step 1 of 3), Privileges
Selection (step 2 of 3) and Final (Review Selection) (step 3 of 3). The Final (Review Selection) window displays the
SQL code generated by wizard selections.
To launch the Grant Wizard tool, select a database object in the pgAdmin tree control, then navigate through Tools on
the menu bar to click on the Grant Wizard option.
Use the fields in the Object Selection (step 1 of 3) window to select the object or objects on which you are modifying
privileges. Use the Search by object type or name field to locate a database object, or use the scrollbar to scroll through
the list of all accessible objects.
• Each row in the table lists object identifiers; check the checkbox in the left column to include an object as a
target of the Grant Wizard. The table displays:
– The object type in the Object Type field
– The schema in which the object resides in the Schema field
– The object name in the Name field.
Click the Next button to continue, or the Cancel button to close the wizard without modifying privileges.
Use the fields in the Privileges Selection (step 2 of 3) window to grant privileges. If you grant a privilege WITH
GRANT OPTION, the Grantee will have the right to grant privileges on the object to others. If WITH GRANT
OPTION is subsequently revoked, any role who received access to that object from that Grantee (directly or through a
chain of grants) will lose thier privileges on the object.
• Click the Add icon (+) to assign a set of privileges.
• 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
privileges to the specified user. If privileges have previously been granted on a database object, unchecking a
privilege for a group or user will result in revoking that privilege.
• The current user, who is the default grantor for granting the privilege, is displayed in the Grantor field.
• Click the Add icon (+) to assign a set of privileges to another role; to discard a privilege, click the trash icon to
the left of the row and confirm deletion in the Delete Row dialog.
For more information about granting privileges on database objects, see the PostgreSQL core documentation.
Click the Next button to continue, the Back button to select or deselect additional database objects, or the Cancel
button to close the wizard without modifying privileges.
Your entries in the Grant Wizard tool generate a SQL command; you can review the command in the Final (Review
Selection) (step 3 of 3) window (see an example below).
6.3.1 Example
The following is an example of the sql command generated by user selections in the Grant Wizard tool:
The commands displayed assign a role named Bob INSERT and UPDATE privileges WITH GRANT OPTION on the
sales_meetings and the sales_territories tables.
• Click the Back button to select or deselect additional database objects, roles and privileges.
• Click the Cancel button to exit without saving work.
• Click the Finish button to save selections and exit the wizard.
Use the Import/Export data dialog to copy data from a table to a file, or copy data from a file into a table.
The Import/Export data dialog organizes the import/export of data through the Options and Columns tabs.
Use the fields in the Options tab to specify import and export preferences:
• Move the Import/Export switch to the Import position to specify that the server should import data to a table
from a file. The default is Export.
• Use the fields in the File Info field box to specify information about the source or target file:
– Enter the name of the source or target file in the Filename field. Optionally, select the Browser icon
(ellipsis) to the right to navigate into a directory and select a file.
– Use the drop-down listbox in the Format field to specify the file type. Select:
• Use the fields in the Miscellaneous field box to specify additional information:
– Move the OID switch to the Yes position to include the OID column. The OID is a system-assigned value
that may not be modified. The default is No.
– Move the Header switch to the Yes position to include the table header with the data rows. If you include
the table header, the first row of the file will contain the column names.
– If you are exporting data, specify the delimiter that will separate the columns within the target file in the
Delimiter field. The separating character can be a colon, semicolon, a vertical bar, or a tab.
– Specify a quoting character used in the Quote field. Quoting can be applied to string columns only (i.e.
numeric columns will not be quoted) or all columns regardless of data type. The character used for quoting
can be a single quote or a double quote.
– Specify a character that should appear before a data character that matches the QUOTE value in the Escape
field.
Use the fields in the Columns tab to select the columns that will be imported or exported:
• Click inside the Columns to export/import field to deselect one or more columns from the drop-down listbox.
To delete a selection, click the x to the left of the column name. Click an empty spot inside the field to access
the drop-down list.
• Use the NULL Strings field to specify a string that will represent a null value within the source or target file.
• If enabled, click inside the Not null columns field to select one or more columns that will not be checked for a
NULL value. To delete a column, click the x to the left of the column name.
After completing the Import/Export data dialog, click the OK button to perform the import or export. pgAdmin will
inform you when the background process completes:
Use the Maintenance dialog to VACUUM, ANALYZE, REINDEX or CLUSTER a database or selected database
objects.
While this utility is useful for ad-hoc maintenance purposes, you are encouraged to perform automatic VACUUM jobs
on a regular schedule.
Select a button next to Maintenance operation to specify the type of maintenance:
• Click VACUUM to scan the selected database or table to reclaim storage used by dead tuples.
– Move the FULL switch to the Yes position to compact tables by writing a completely new version of the
table file without dead space. The default is No.
– Move the FREEZE switch to the Yes position to freeze data in a table when it will have no further updates.
The default is No.
– Move the ANALYZE switch to the Yes position to issue ANALYZE commands whenever the content of a
table has changed sufficiently. The default is No.
• Click ANALYZE to update the stored statistics used by the query planner. This enables the query optimizer to
select the fastest query plan for optimal performance.
• Click REINDEX to rebuild any index in case it has degenerated due to the insertion of unusual data patterns.
This happens, for example, if you insert rows with increasing index values, and delete low index values.
• Click CLUSTER to instruct PostgreSQL to cluster the selected table.
To exclude status messages from the process output, move the Verbose Messages switch to the No position; by default,
status messages are included.
When you’ve completed the dialog, click OK to start the background process; to exit the dialog without performing
maintenance operations, click Cancel.
pgAdmin will inform you when the background process completes:
A powerful, but user-friendly Backup and Restore tool provides an easy way to use pg_dump, pg_dumpall, and
pg_restore to take backups and create copies of databases or database objects for use in a development environment.
Using the pg_dump utility, pgAdmin provides an easy way to create a backup in a plain-text or archived format. You
can then use a client application (like psql or the Query Tool) to restore a plain-text backup file, or use the Postgres
pg_restore utility to restore an archived backup. The pg_dump utility must have read access to all database objects
that you want to back up.
You can backup a single table, a schema, or a complete database. Select the name of the backup source in the pgAdmin
tree control, right click to open the context menu, and select Backup. . . to open the Backup dialog. The name of the
object selected will appear in the dialog title bar.
269
pgAdmin 4 Documentation, Release 4.25
Use the fields in the General tab to specify parameters for the backup:
• Enter the name of the backup file in the Filename field. Optionally, select the Browser icon (. . . ) to the right to
navigate into a directory and select a file that will contain the archive.
• Use the drop-down listbox in the Format field to select the format that is best suited for your application. Each
format has advantages and disadvantages:
– Select Custom to create a custom archive file that you can use with pg_restore to create a copy of a database.
Custom archive file formats must be restored with pg_restore. This format offers the opportunity to select
which database objects to restore from the backup file. Custom archive format is recommended for medium
to large databases as it is compressed by default.
– Select Tar to generate a tar archive file that you can restore with pg_restore. The tar format does not
support compression.
– Select Plain to create a plain-text script file. A plain-text script file contains SQL statements and commands
that you can execute at the psql command line to recreate the database objects and load the table data. A
plain-text backup file can be edited in a text editor, if desired, before using the psql program to restore
database objects. Plain format is normally recommended for smaller databases; script dumps are not
recommended for blobs. The SQL commands within the script will reconstruct the database to the last
saved state of the database. A plain-text script can be used to reconstruct the database on another machine,
or (with modifications) on other architectures.
– Select Directory to generate a directory-format archive suitable for use with pg_restore. This file format
creates a directory with one file for each table and blob being dumped, plus a Table of Contents file
describing the dumped objects in a machine-readable format that pg_restore can read. This format is
compressed by default.
• Use the Compression Ratio field to select a compression level for the backup. Specify a value of zero to mean
use no compression; specify a maximum compression value of 9. Please note that tar archives do not support
compression.
• Use the Encoding drop-down listbox to select the character encoding method that should be used for the archive.
• Use the Number of Jobs field (when applicable) to specify the number of tables that will be dumped simultane-
ously in a parallel backup.
• Use the dropdown listbox next to Rolename to specify the role that owns the backup.
Click the Dump options tab to continue. Use the box fields in the Dump options tab to provide options for pg_dump.
• Move switches in the Sections field box to select a portion of the object that will be backed up.
– Move the switch next to Pre-data to the Yes position to include all data definition items not included in the
data or post-data item lists.
– Move the switch next to Data to the Yes position to backup actual table data, large-object contents, and
sequence values.
– Move the switch next to Post-data to the Yes position to include definitions of indexes, triggers, rules, and
constraints other than validated check constraints.
• Move switches in the Type of objects field box to specify details about the type of objects that will be backed
up.
– Move the switch next to Only data to the Yes position to limit the back up to data.
– Move the switch next to Only schema to limit the back up to schema-level database objects.
– Move the switch next to Blobs to the No position to exclude large objects in the backup.
• Move switches in the Do not save field box to select the objects that will not be included in the backup.
– Move the switch next to Owner to the Yes position to exclude commands that set object ownership.
– Move the switch next to Privilege to the Yes position to exclude commands that create access privileges.
– Move the switch next to Tablespace to the Yes position to exclude tablespaces.
– Move the switch next to Unlogged table data to the Yes position to exclude the contents of unlogged tables.
– Move the switch next to Comments to the Yes position to exclude commands that set the comments. Note:
This option is visible only for database server greater than or equal to 11.
• Move switches in the Queries field box to specify the type of statements that should be included in the backup.
– Move the switch next to Use Column Inserts to the Yes position to dump the data in the form of INSERT
statements and include explicit column names. Please note: this may make restoration from backup slow.
– Move the switch next to Use Insert commands to the Yes position to dump the data in the form of INSERT
statements rather than using a COPY command. Please note: this may make restoration from backup slow.
– Move the switch next to Include CREATE DATABASE statement to the Yes position to include a command
in the backup that creates a new database when restoring the backup.
– Move the switch next to Include DROP DATABASE statement to the Yes position to include a command
in the backup that will drop any existing database object with the same name before recreating the object
during a backup.
– Move the switch next to Load Via Partition Root to the Yes position, so when dumping a COPY or INSERT
statement for a partitioned table, target the root of the partitioning hierarchy which contains it rather than
the partition itself. Note: This option is visible only for database server greater than or equal to 11.
• Move switches in the Disable field box to specify the type of statements that should be excluded from the
backup.
– Move the switch next to Trigger (active when creating a data-only backup) to the Yes position to include
commands that will disable triggers on the target table while the data is being loaded.
– Move the switch next to $ quoting to the Yes position to enable dollar quoting within function bodies; if
disabled, the function body will be quoted using SQL standard string syntax.
• Move switches in the Miscellaneous field box to specify miscellaneous backup options.
– Move the switch next to With OIDs to the Yes position to include object identifiers as part of the table data
for each table.
– Move the switch next to Verbose messages to the No position to instruct pg_dump to exclude verbose
messages.
– Move the switch next to Force double quotes on identifiers to the Yes position to force the quoting of all
identifiers.
– Move the switch next to Use SET SESSION AUTHORIZATION to the Yes position to include a statement
that will use a SET SESSION AUTHORIZATION command to determine object ownership (instead of an
ALTER OWNER command).
When you’ve specified the details that will be incorporated into the pg_dump command:
• Click the Backup button to build and execute a command that builds a backup based on your selections on the
Backup dialog.
• Click the Cancel button to exit without saving work.
If the backup is unsuccessful, you can review the error messages returned by the backup command on the Process
Watcher.
Use the Backup Globals dialog to create a plain-text script that recreates all of the database objects within a cluster, and
the global objects that are shared by those databases. Global objects include tablespaces, roles, and object properties.
You can use the pgAdmin Query Tool to play back a plain-text script, and recreate the objects in the backup.
• Use the drop-down listbox next to Role name to specify a role with connection privileges on the selected server.
The role will be used for authentication during the backup.
Move switches in the Miscellaneous field box to specify the type of statements that should be included in the backup.
• Move the Verbose messages switch to the No position to exclude status messages from the backup. The default
is Yes.
• Move the Force double quote on identifiers switch to the Yes position to name identifiers without changing case.
The default is No.
Click the Backup button to build and execute a command based on your selections; click the Cancel button to exit
without saving work.
If the backup is unsuccessful, review the error message returned by the Process Watcher to resolve any issue.
Use the Backup Server dialog to create a plain-text script that will recreate the selected server. You can use the
pgAdmin Query Tool to play back a plain-text script, and recreate the server.
• Move switches in the Type of objects field box to specify details about the type of objects that will be backed
up.
– Move the switch next to Only data to the Yes position to limit the back up to data.
– Move the switch next to Only schema to limit the back up to schema-level database objects.
• Move switches in the Do not save field box to select the objects that will not be included in the backup.
– Move the switch next to Owner to the Yes position to exclude commands that set object ownership.
– Move the switch next to Privilege to the Yes position to exclude commands that create access privileges.
– Move the switch next to Tablespace to the Yes position to exclude tablespaces.
– Move the switch next to Unlogged table data to the Yes position to exclude the contents of unlogged tables.
– Move the switch next to Comments to the Yes position to exclude commands that set the comments. Note:
This option is visible only for database server greater than or equal to 11.
• Move switches in the Queries field box to specify the type of statements that should be included in the backup.
– Move the switch next to Use Column Inserts to the Yes position to dump the data in the form of INSERT
statements and include explicit column names. Please note: this may make restoration from backup slow.
– Move the switch next to Use Insert commands to the Yes position to dump the data in the form of INSERT
statements rather than using a COPY command. Please note: this may make restoration from backup slow.
– Move the switch next to Include DROP DATABASE statement to the Yes position to include a command
in the backup that will drop any existing database object with the same name before recreating the object
during a backup.
• Move switches in the Disable field box to specify the type of statements that should be excluded from the
backup.
– Move the switch next to Trigger (active when creating a data-only backup) to the Yes position to include
commands that will disable triggers on the target table while the data is being loaded.
– Move the switch next to $ quoting to the Yes position to enable dollar quoting within function bodies; if
disabled, the function body will be quoted using SQL standard string syntax.
• Move switches in the Miscellaneous field box to specify miscellaneous backup options.
– Move the switch next to With OIDs to the Yes position to include object identifiers as part of the table data
for each table.
– Move the switch next to Verbose messages to the No position to instruct pg_dump to exclude verbose
messages.
– Move the switch next to Force double quotes on identifiers to the Yes position to force the quoting of all
identifiers.
– Move the switch next to Use SET SESSION AUTHORIZATION to the Yes position to include a statement
that will use a SET SESSION AUTHORIZATION command to determine object ownership (instead of an
ALTER OWNER command).
Click the Backup button to build and execute a command based on your selections; click the Cancel button to exit
without saving work.
If the backup is unsuccessful, review the error message returned by the Process Watcher to resolve any issue.
The Restore dialog provides an easy way to use a Custom, tar, or Directory format backup taken with the pgAdmin
Backup dialog to recreate a database or database object. The Backup dialog invokes options of the pg_dump client
utility; the Restore dialog invokes options of the pg_restore client utility.
You can use the Query Tool to play back the script created during a plain-text backup made with the Backup dialog.
For more information about backing up or restoring, please refer to the documentation for pg_dump or pg_restore.
Use the fields on the General tab to specify general information about the restore process:
• Use the drop-down listbox in the Format field to select the format of your backup file.
– Select Custom or tar to restore from a custom archive file to create a copy of the backed-up object.
– Select Directory to restore from a compressed directory-format archive.
• Enter the complete path to the backup file in the Filename field. Optionally, select the Browser icon (ellipsis) to
the right to navigate into a directory and select the file that contains the archive.
• Use the Number of Jobs field to specify if pg_restore should use multiple (concurrent) jobs to process the restore.
Each job uses a separate connection to the server.
• Use the drop-down listbox next to Rolename to specify the role that will be used to authenticate with the server
during the restore process.
Click the Restore options tab to continue. Use the fields on the Restore options tab to specify options that correspond
to pg_restore options.
• Use the switches in the Sections box to specify the content that will be restored:
– Move the switch next to Pre-data to the Yes position to restore all data definition items not included in the
data or post-data item lists.
– Move the switch next to Data to the Yes position to restore actual table data, large-object contents, and
sequence values.
– Move the switch next to Post-data to the Yes position to restore definitions of indexes, triggers, rules, and
constraints (other than validated check constraints).
• Use the switches in the Type of objects box to specify the objects that will be restored:
– Move the switch next to Only data to the Yes position to limit the restoration to data.
– Move the switch next to Only schema to limit the restoration to schema-level database objects.
• Use the switches in the Do not save box to specify which objects will not be restored:
– Move the switch next to Owner to the Yes position to exclude commands that set object ownership.
– Move the switch next to Privilege to the Yes position to exclude commands that create access privileges.
– Move the switch next to Tablespace to the Yes position to exclude tablespaces.
– Move the switch next to Comments to the Yes position to exclude commands that set the comments. Note:
This option is visible only for database server greater than or equal to 11.
• Use the switches in the Queries box to specify the type of statements that should be included in the restore:
– Move the switch next to Include CREATE DATABASE statement to the Yes position to include a command
that creates a new database before performing the restore.
– Move the switch next to Clean before restore to the Yes position to drop each existing database object (and
data) before restoring.
– Move the switch next to Single transaction to the Yes position to execute the restore as a single transaction
(that is, wrap the emitted commands in BEGIN/COMMIT). This ensures that either all the commands
complete successfully, or no changes are applied. This option implies –exit-on-error.
• Use the switches in the Disable box to specify the type of statements that should be excluded from the restore:
– Move the switch next to Trigger (active when creating a data-only restore) to the Yes position to include
commands that will disable triggers on the target table while the data is being loaded.
– Move the switch next to No data for Failed Tables to the Yes position to ignore data that fails a trigger.
• Use the switches in the Miscellaneous/Behavior box to specify miscellaneous restore options:
– Move the switch next to Verbose messages to the No position to instruct pg_restore to exclude verbose
messages.
– Move the switch next to Use SET SESSION AUTHORIZATION to the Yes position to include a statement
that will use a SET SESSION AUTHORIZATION command to determine object ownership (instead of an
ALTER OWNER command).
– Move the switch next to Exit on error to the Yes position to instruct pg_restore to exit restore if there is an
error in sending SQL commands. The default is to continue and to display a count of errors at the end of
the restore.
When you’ve specified the details that will be incorporated into the pg_restore command, click the Restore button to
start the process, or click the Cancel button to exit without saving your work. A popup will confirm if the restore is
successful.
Developer Tools
The pgAdmin Tools menu displays a list of powerful developer tools that you can use to execute and analyze complex
SQL commands, manage data, and debug PL/SQL code.
8.1 Debugger
The debugger may be used to debug PL/pgSQL functions in PostgreSQL, as well as EDB-SPL functions, stored
procedures and packages in EDB Postgres Advanced Server. The Debugger is available as an extension for your
PostgreSQL installation, and is distributed as part of Advanced Server. You must have superuser privileges to use the
debugger.
Before using the debugger, you must modify the postgresql.conf file, adding the server-side debugger components to
the the value of the shared_preload_libraries parameter, for example:
shared_preload_libraries = ‘$libdir/plugin_debugger’
After modifying the shared_preload_libraries parameter, restart the server to apply the changes.
285
pgAdmin 4 Documentation, Release 4.25
The debugger may be used for either in-context debugging or direct debugging of a target function or procedure.
When you use the debugger for in-context debugging, you set a breakpoint at the first line of a program; when a
session invokes the target, control is transferred to the debugger. When using direct debugging, the debugger prompts
you for any parameters required by the target, and then allows you to step through the code.
To set a breakpoint at the first line of a program, right-click the name of the object you would like to debug, and select
Set breakpoint from the Debugging sub-menu. The debugger window will open, waiting for another session to invoke
the program.
When another session invokes the target, the debugger will display the code, allowing you to add break points, or step
through line-by-line. The other session is suspended until the debugging completes; then control is returned to the
session.
To use the debugger for direct debugging, right click on the name of the object that you wish to debug in the pgAdmin
tree control and select Debug from the Debugging sub-menu. The debugger window will open, prompting you for any
values required by the program:
Use the fields on the Debugger dialog to provide a value for each parameter:
• The Name field contains the formal parameter name.
• The Type field contains the parameter data type.
• Check the Null? checkbox to indicate that the parameter is a NULL value.
• Check the Expression? checkbox if the Value field contains an expression.
• Use the Value field to provide the parameter value that will be passed to the program. When entering parameter
values, type the value into the appropriate cell on the grid, or, leave the cell empty to represent NULL, enter
‘’ (two single quotes) to represent an empty string, or to enter a literal string consisting of just two single
quotes, enter ''. PostgreSQL 8.4 and above supports variadic function parameters. These may be entered as a
comma-delimited list of values, quoted and/or cast as required.
• Check the Use default? checkbox to indicate that the program should use the value in the Default Value field.
• The Default Value field contains the default value of the parameter.
Provide values required by the program, and click the Debug button to start stepping through the program. The values
of the arguments provided here are saved. The values will be pre-filled next time the dialog opens. To clear the values,
use the Clear All button.
The main debugger window consists of two panels and a context-sensitive toolbar. Use toolbar icons to manage
breakpoints and step into or through code; hover over an icon for a tooltip that identifies the option associated with the
icon. The toolbar options are:
Option Action
Step into Click the Step into icon to execute the currently highlighted line of code.
Step over Click the Step over icon to execute a line of code, stepping over any sub-functions invoked by the
code. The sub-function executes, but is not debugged unless it contains a breakpoint.
Con- Click the Continue/Start icon to execute the highlighted code, and continue until the program en-
tinue/Start counters a breakpoint or completes.
Toggle Use the Toggle breakpoint icon to enable or disable a breakpoint (without removing the breakpoint).
breakpoint
Clear all Click the Clear all breakpoints icon to remove all breakpoints from the program.
break-
points
Stop Click the Stop icon to halt the execution of a program.
The top panel of the debugger window displays the program body; click in the grey margin next to a line number to
add a breakpoint. The highlighted line in the top panel is the line that is about to execute.
The lower panel of the debugger window provides a set of tabs that allow you to review information about the program:
• The Parameters tab displays the value of each parameter.
• The Local variables tab displays the current value of the program variables.
• The Messages tab displays any messages returned by the server (errors, warnings and informational messages).
• The Results tab displays the server message when the program completes.
• The Stack tab displays the list of functions that have been invoked, but which have not yet completed.
As you step through a program, the Local variables tab displays the current value of each variable:
When you step into a subroutine, the Stack tab displays the call stack, including the name of each caller, the parameter
values for each caller (if any), and the line number within each caller:
Select a caller to change focus to that stack frame and display the state of the caller in the upper panel.
When the program completes, the Results tab displays the message returned by the server. If the program encounters
an error, the Messages tab displays details:
The Query Tool is a powerful, feature-rich environment that allows you to execute arbitrary SQL commands and
review the result set. You can access the Query Tool via the Query Tool menu option on the Tools menu, or through
the context menu of select nodes of the Browser tree control. The Query Tool allows you to:
• Issue ad-hoc SQL queries.
• Execute arbitrary SQL commands.
• Edit the result set of a SELECT query if it is updatable.
• Displays current connection and transaction status as configured by the user.
• Save the data displayed in the output panel to a CSV file.
• Review the execution plan of a SQL statement in either a text, a graphical format or a table format (similar to
https://explain.depesz.com).
• View analytical information about a SQL statement.
You can open multiple copies of the Query tool in individual tabs simultaneously. To close a copy of the Query tool,
click the X in the upper-right hand corner of the tab bar.
The Query Tool features two panels:
• The upper panel displays the SQL Editor. You can use the panel to enter, edit, or execute a query. It also shows
the History tab which can be used to view the queries that have been executed in the session, and a Scratch
Pad which can be used to hold text snippets during editing. If the Scratch Pad is closed, it can be re-opened (or
additional ones opened) by right-clicking in the SQL Editor and other panels and adding a new panel.
• The lower panel displays the Data Output panel. The tabbed panel displays the result set returned by a query, in-
formation about a query’s execution plan, server messages related to the query’s execution and any asynchronous
notifications received from the server.
8.2.1 Toolbar
The Query Tool toolbar uses context-sensitive icons that provide shortcuts to frequently performed tasks. If an icon is
highlighted, the option is enabled; if the icon is grayed-out, the task is disabled.
Note: The Query Tool and View/Edit Data tools are actually different operating modes of the same tool. Some
controls will be disabled in either mode.
Hover over an icon in pgAdmin to display a tooltip that describes the icon’s functionality.
File Options
Editing Options
Paste Click the Paste icon to paste a previously copied row into a new row. Accesskey + P
Delete Click the Delete icon to mark the selected rows for deletion. These marked Accesskey + D
rows get deleted when you click the Save Data Changes icon.
Edit Use options on the Edit menu to access text editing tools; the options operate
on the text displayed in the SQL Editor panel when in Query Tool mode:
Select Indent Selection to indent the currently selected text. Tab
Select Unindent Selection to remove indentation from the currently selected Shift+Tab
text.
Select Inline Comment Selection to enclose any lines that contain the selec- Cmd+/
tion in SQL style comment notation.
Select Inline Uncomment Selection to remove SQL style comment notation Cmd+.
from the selected line.
continues on next page
Limit Selector Select a value in the Limit Selector to limit the size of the dataset to a number Accesskey + R
of rows.
Stop Click the Stop icon to cancel the execution of the currently running query. Accesskey + Q
Query Execution
Explain Click the Explain icon to view an explanation plan for the current query. F7
The result of the EXPLAIN is displayed graphically on the Explain tab of
the output panel, and in text form on the Data Output tab.
continues on next page
Download as Click the Download as CSV/TXT icon to download the result set of the cur- F8
CSV/TXT rent query as a .csv or as a .txt file. if CSV field seperator set to comma(,)
else as a .txt file. You can specify the CSV/TXT settings through Prefer-
ences -> SQL Editor -> CSV/TXT output dialogue.
The SQL editor panel is a workspace where you can manually provide a query, copy a query from another source, or
read a query from a file. The SQL editor features syntax coloring and autocompletion.
To use autocomplete, begin typing your query; when you would like the Query editor to suggest object names or
commands that might be next in your query, press the Control+Space key combination. For example, type “*SELECT
* FROM* ” (without quotes, but with a trailing space), and then press the Control+Space key combination to select
After entering a query, select the Execute/Refresh icon from the toolbar. The complete contents of the SQL editor
panel will be sent to the database server for execution. To execute only a section of the code that is displayed in the
SQL editor, highlight the text that you want the server to execute, and click the Execute/Refresh icon.
The message returned by the server when a command executes is displayed on the Messages tab. If the command is
successful, the Messages tab displays execution details.
Options on the Edit menu offer functionality that helps with code formatting and commenting:
• The auto-indent feature will automatically indent text to the same depth as the previous line when you press the
Return key.
• Block indent text by selecting two or more lines and pressing the Tab key.
• Implement or remove SQL style or toggle C style comment notation within your code.
You can also drag and drop certain objects from the treeview which can save time in typing long object names. Text
containing the object name will be fully qualified with schema. Double quotes will be added if required. For functions
and procedures, the function name along with parameter names will be pasted in the Query Tool.
The Data Output panel displays data and statistics generated by the most recently executed query.
The Data Output tab displays the result set of the query in a table format. You can:
• Select and copy from the displayed result set.
• Use the Execute/Refresh options to retrieve query execution information and set query execution options.
• Use the Download as CSV/TXT icon to download the content of the Data Output tab as a comma-delimited file.
• Edit the data in the result set of a SELECT query if it is updatable.
A result set is updatable if:
• All columns are either selected directly from a single table, or are not table columns at all (e.g. concatenation of
2 columns). Only columns that are selected directly from the table are editable, other columns are read-only.
• All the primary key columns or OIDs of the table are selected in the result set.
Any columns that are renamed or selected more than once are also read-only.
Editable and read-only columns are identified using pencil and lock icons (respectively) in the column headers.
The psycopg2 driver version should be equal to or above 2.8 for updatable query result sets to work.
An updatable result set is identical to the Data Grid in View/Edit Data mode, and can be modified in the same way.
If Auto-commit is off, the data changes are made as part of the ongoing transaction, if no transaction is ongoing a new
one is initiated. The data changes are not committed to the database unless the transaction is committed.
If any errors occur during saving (for example, trying to save NULL into a column with NOT NULL constraint) the
data changes are rolled back to an automatically created SAVEPOINT to ensure any previously executed queries in
the ongoing transaction are not rolled back.
All rowsets from previous queries or commands that are displayed in the Data Output panel will be discarded when
you invoke another query; open another Query Tool tab to keep your previous results available.
To generate the Explain or Explain Analyze plan of a query, click on Explain or Explain Analyze button in the toolbar.
More options related to Explain and Explain Analyze can be selected from the drop down on the right side of Explain
Analyze button in the toolbar.
Please note that pgAdmin generates the Explain [Analyze] plan in JSON format.
On successful generation of Explain plan, it will create three tabs/panels under the Explain panel.
• Graphical
Please note that EXPLAIN VERBOSE cannot be displayed graphically. Hover over an icon on the Graphical tab to
review information about that item; a popup window will display information about the selected object. For informa-
tion on JIT statistics, triggers and a summary, hover over the icon on top-right corner; a similar popup window will be
displayed when appropriate.
Use the download button on top left corner of the Explain canvas to download the plan as an SVG file.
Note that the query plan that accompanies the Explain analyze is available on the Data Output tab.
• Table
Table tab shows the plan details in table format, it generates table format similar to explain.depsez.com. Each row of
the table represent the data for a Explain Plan Node. It may contain the node information, exclusive timing, inclusive
timing, actual vs planned rows differences, actual rows, planned rows, loops.
background color of the exclusive, inclusive, and Rows X columns may vary based on the difference between actual
vs planned.
If percentage of the exclusive/inclusive timings of the total query time is: > 90 - Red color > 50 - Orange (between red
and yellow) color > 10 - Yellow color
If planner mis-estimated number of rows (actual vs planned) by 10 times - Yellow color 100 times - Orange (between
Red and Yellow) color 1000 times - Red color
• Statistics
Statistics tab shows two tables: 1. Statistics per Plan Node Type 2. Statistics per Table
Use the Messages tab to view information about the most recently executed query:
If the server returns an error, the error message will be displayed on the Messages tab, and the syntax that caused the
error will be underlined in the SQL editor. If a query succeeds, the Messages tab displays how long the query took to
complete and how many rows were retrieved:
Use the Query History tab to review activity for the current session:
Use the Connection status feature to view the current connection and transaction status by clicking on the status icon
in the Query Tool:
To view or modify data, right click on a table or view name in the Browser tree control. When the context menu opens,
use the View/Edit Data menu to specify the number of rows you would like to display in the editor panel.
To modify the content of a table, each row in the table must be uniquely identifiable. If the table definition does not
include an OID or a primary key, the displayed data is read only. Note that views cannot be edited; updatable views
(using rules) are not supported.
The editor features a toolbar that allows quick access to frequently used options, and a work environment divided into
two panels:
• The upper panel displays the SQL command that was used to select the content displayed in the lower panel.
• The lower panel (the Data Grid) displays the data selected from the table or view.
The Query Tool and View/Edit Data tools are actually different operating modes of the same tool. Some controls will
be disabled in either mode. Please see The Query Tool Toolbar for a description of the available controls.
The top row of the data grid displays the name of each column, the data type, and if applicable, the number of
characters allowed. A column that is part of the primary key will additionally be marked with [PK].
To modify the displayed data:
• To change a numeric value within the grid, double-click the value to select the field. Modify the content in the
square in which it is displayed.
• To change a non-numeric value within the grid, double-click the content to access the edit bubble. After mod-
ifying the contentof the edit bubble, click the Ok button to display your changes in the data grid, or Cancel to
exit the edit bubble without saving.
To enter a newline character, click Ctrl-Enter or Shift-Enter. Newline formatting is only displayed when the field
content is accessed via an edit bubble.
To add a new row to the table, enter data into the last (unnumbered) row of the table. As soon as you store the data,
the row is assigned a row number, and a fresh empty line is added to the data grid.
To write a SQL NULL to the table, simply leave the field empty. When you store the new row, the will server fill in
the default value for that column. If you store a change to an existing row, the value NULL will explicitly be written.
To write an empty string to the table, enter the special string ‘’ (two single quotes) in the field. If you want to write a
string containing solely two single quotes to the table, you need to escape these quotes, by typing ''
To delete a row, press the Delete toolbar button. A popup will open, asking you to confirm the deletion.
To commit the changes to the server, select the Save Data toolbar button.
Geometry Data Viewer
If PostGIS is installed, you can view GIS objects in a map by selecting row(s) and clicking the ‘View Geometry’
button in the column. If no rows are selected, the entire data set will be rendered:
You can adjust the layout by dragging the title of the panel. To view the properties of the geometries directly in map,
just click the specific geometry:
Note:
• Supported data types: The Geometry Viewer supports 2D and 3DM geometries in EWKB format including
You can access Sort/Filter options dialog by clicking on Sort/Filter button. This allows you to specify an SQL Filter
to limit the data displayed and data sorting options in the edit grid window:
• Use SQL Filter to provide SQL filtering criteria. These will be added to the “WHERE” clause of the query used
to retrieve the data. For example, you might enter:
You can access Data Filter dialog by clicking on Filtered Rows toolbar button visible on the Browser panel or by
selecting View/Edit Data -> Filtered Rows context menu option.
This allows you to specify an SQL Filter to limit the data displayed in the edit grid window:
Schema Diff is a feature that allows you to compare objects between two databases. Use the Tools menu to access
Schema Diff.
The Schema Diff feature allows you to:
• Compare and synchronize the database objects (from source to target).
• Visualize the differences between database objects.
• List the differences in SQL statement for target database objects.
• Generate synchronization scripts.
Note - The source and target database servers must be of the same major version.
Click on Schema Diff under the Tools menu to open a selection panel. Choose the source and target servers, and
databases that will be compared. After selecting the objects, click on the Compare button.
You can open multiple copies of Schema Diff in individual tabs simultaneously. To close a copy of Schema Diff, click
the X in the upper-right hand corner of the tab bar.
Use the Preferences dialog to specify if Schema Diff should open in a new browser tab. Set Open in new browser tab
option to true.
The Schema Diff panel is divided into two panels; an Object Comparison panel and a DDL Comparison panel.
In the object comparison panel, you can select the source and target servers of the same major version, and databases
to be compared. You can select any server listed under the browser tree whether it is connected or disconnected. If
you select a server that is not connected then it will prompt you for the password before using the server.
Next, select the databases that will be compared. The databases can be the same or different (and within the same
server or from different servers).
After you select servers, and databases, click on the Compare button to obtain the Comparison Result.
Use the drop-down lists of Database Objects to view the DDL statements.
In the upper-right hand corner of the object comparison panel is a Filter option that you can use to filter the database
objects based on the following comparison criteria:
• Identical – If the object is found in both databases with the same SQL statement, then the comparison result is
identical.
• Different – If the object is found in both databases but have different SQL statements, then the comparison result
is different.
• Source Only – If the object is found in source database only and not in target database, then the comparison
result is source only.
• Target Only – If the object is found in target database only and not in source database, then the comparison
result is target only.
Click on any of the database objects in the object comparison panel to display the DDL Statements of that object in
the DDL Comparison panel.
You can review the DDL statements of all the database objects to check for the differences in the SQL statements.
Also, you can generate the SQL script of the differences found in the target database object based on the SQL statement
of the source database object. To generate the script, select the checkboxes of the database objects in the object
comparison panel and then click on the Generate Script button in the upper-right hand corner of the object comparison
panel.
Select the database objects and click on the Generate Script button to open the Query Tool in a new tab, with the
difference in the SQL statement displayed in the Query Editor.
If you have clicked on the database object to check the difference generated in the DDL Comparison Panel, and you
have not selected the checkbox of the database object, pgAdmin will open the Query Tool in a new tab, with the
differences in the SQL statements displayed in the Query Editor.
You can also use the Copy button to copy the difference generated in the DDL Comparison panel.
Apply the SQL Statement in the target database to synchronize the databases.
pgAgent
pgAgent is a job scheduling agent for Postgres databases, capable of running multi-step batch or shell scripts and SQL
tasks on complex schedules.
pgAgent is distributed independently of pgAdmin. You can download pgAgent from the download area of the pgAd-
min website.
pgAgent is a scheduling agent that runs and manages jobs; each job consists of one or more steps and schedules. If
two or more jobs are scheduled to execute concurrently, pgAgent will execute the jobs in parallel (each with it’s own
thread).
A step may be a series of SQL statements or an operating system batch/shell script. Each step in a given job is
executed when the previous step completes, in alphanumeric order by name. Switches on the pgAgent Job dialog
(accessed through the Properties context menu) allow you to modify a job, enabling or disabling individual steps as
needed.
Each job is executed according to one or more schedules. Each time the job or any of its schedules are altered, the
next runtime of the job is re-calculated. Each instance of pgAgent periodically polls the database for jobs with the
next runtime value in the past. By polling at least once every minute, all jobs will normally start within one minute of
the specified start time. If no pgAgent instance is running at the next runtime of a job, it will run as soon as pgAgent
is next started, following which it will return to the normal schedule.
When you highlight the name of a defined job in the pgAdmin tree control, the Properties tab of the main pgAdmin
window will display details about the job, and the Statistics tab will display details about the job’s execution.
313
pgAdmin 4 Documentation, Release 4.25
pgAgent is a very powerful tool, but does have some security considerations that you should be aware of:
Database password - DO NOT be tempted to include a password in the pgAgent connection string - on Unix systems
it may be visible to all users in ps output, and on Windows systems it will be stored in the registry in plain text. Instead,
use a libpq ~/.pgpass file to store the passwords for every database that pgAgent must access. Details of this technique
may be found in the PostgreSQL documentation on .pgpass file.
System/database access - all jobs run by pgAgent will run with the security privileges of the pgAgent user. SQL steps
will run as the user that pgAgent connects to the database as, and batch/shell scripts will run as the operating system
user that the pgAgent service or daemon is running under. Because of this, it is essential to maintain control over the
users that are able to create and modify jobs. By default, only the user that created the pgAgent database objects will
be able to do this - this will normally be the PostgreSQL superuser.
pgAgent runs as a daemon on Unix systems, and a service on Windows systems. In most cases it will run on the
database server itself - for this reason, pgAgent is not automatically configured when pgAdmin is installed. In some
cases however, it may be preferable to run pgAgent on multiple systems, against the same database; individual jobs
may be targeted at a particular host, or left for execution by any host. Locking prevents execution of the same instance
of a job by multiple hosts.
Before using pgAdmin to manage pgAgent, you must create the pgAgent extension in the maintenance database
registered with pgAdmin. To install pgAgent on a PostgreSQL host, connect to the postgres database, and navigate
through the Tools menu to open the Query tool. For server versions 9.1 or later, and pgAgent 3.4.0 or later, enter the
following command in the query window, and click the Execute icon:
This command will create a number of tables and other objects in a schema called ‘pgagent’.
The database must also have the pl/pgsql procedural language installed - use the PostgreSQL CREATE LANGUAGE
command to install pl/pgsql if necessary. To install pl/pgsql, enter the following command in the query window, and
click the Execute icon:
If you are using an earlier version of PostgreSQL or pgAgent, use the Open file icon on the Query Tool toolbar to
open a browser window and locate the pgagent.sql script. The installation script is installed by pgAdmin, and the
installation location varies from operating system to operating system:
• On Windows, it is usually located under C:\Program files\pgAdmin III (or C:\Program
files\PostgreSQL\8.x\pgAdmin III if installed with the PostgreSQL server installer).
• On Linux, it is usually located under /usr/local/pgadmin3/share/pgadmin3 or /usr/share/pgadmin3.
After loading the file into the Query Tool, click the Execute icon to execute the script. The script will create a number
of tables and other objects in a schema named pgagent.
Note: pgAgent is available in Debian/Ubuntu (DEB) and Redhat/Fedora (RPM) packages for Linux users, as well as
source code. See the pgAdmin Website. for more information.
To install the pgAgent daemon on a Unix system, you will normally need to have root privileges to modify the
system startup scripts. Modifying system startup scripts is quite system-specific so you should consult your system
documentation for further information.
The program itself takes few command line options, most of which are only needed for debugging or specialised
configurations:
Usage:
/path/to/pgagent [options] <connect-string>
options:
-f run in the foreground (do not detach from the terminal)
-t <poll time interval in seconds (default 10)>
-r <retry period after connection abort in seconds (>=10, default 30)>
-s <log file (messages are logged to STDOUT if not specified)>
-l <logging verbosity (ERROR=0, WARNING=1, DEBUG=2, default 0)>
The connection string is a standard PostgreSQL libpq connection string (see the PostgreSQL documentation on the
connection string for further details). For example, the following command line will run pgAgent against a server
listening on the localhost, using a database called ‘pgadmin’, connecting as the user ‘postgres’:
Note: pgAgent is available in a pre-built installer if you use EnterpriseDB’s PostgreSQL Installers. Use the Stack-
Builder application to download and install it. If installed in this way, the service will automatically be created and the
instructions below can be ignored.
pgAgent can install itself as a service on Windows systems. The command line options available are similar to those
on Unix systems, but include an additional parameter to tell the service what to do:
Usage:
pgAgent REMOVE <serviceName>
pgAgent INSTALL <serviceName> [options] <connect-string>
pgAgent DEBUG [options] <connect-string>
options:
-u <user or DOMAIN\user>
-p <password>
-d <displayname>
-t <poll time interval in seconds (default 10)>
-r <retry period after connection abort in seconds (>=10, default 30)>
-l <logging verbosity (ERROR=0, WARNING=1, DEBUG=2, default 0)>
The service may be quite simply installed from the command line as follows (adjust the path as required):
You can then start the service at the command line using net start pgAgent, or from the Services control panel applet.
Any logging output or errors will be reported in the Application event log. The DEBUG mode may be used to run
pgAgent from a command prompt. When run this way, log messages will output to the command window.
pgAgent is a scheduling agent that runs and manages jobs; each job consists of steps and schedules.
To create or manage a job, use the pgAdmin tree control to browse to the server on which the pgAgent database objects
were created. The tree control will display a pgAgent Jobs node, under which currently defined jobs are displayed. To
add a new job, right click on the pgAgent Jobs node, and select Create pgAgent Job. . . from the context menu.
When the pgAgent dialog opens, use the tabs on the pgAgent Job dialog to define the steps and schedule that make up
a pgAgent job.
Use the fields on the General tab to provide general information about a job:
• Provide a name for the job in the Name field.
• Move the Enabled switch to the Yes position to enable a job, or No to disable a job.
• Use the Job Class drop-down to select a class (for job categorization).
• Use the Host Agent field to specify the name of a machine that is running pgAgent to indicate that only that
machine may execute the job. Leave the field blank to specify that any machine may perform the job.
Note: It is not always obvious what value to specify for the Host Agent in order to target a job step to a specific
machine. With pgAgent running on the required machines and connected to the scheduler database, you can use
the following query to view the hostnames as reported by each agent:
Use the hostname exactly as reported by the query in the Host Agent field.
Use the Steps tab to define and manage the steps that the job will perform. Click the Add icon (+) to add a new step;
then click the compose icon (located at the left side of the header) to open the step definition dialog:
Note: The fields Connection type, Database and Connection string are only applicable when SQL is selected because
Batch cannot be run on remote servers.
• Use the Connection type switch to indicate if the step is performed on a local server (Local) or on a remote host
(Remote). If you specify a remote connection should be used for the step, the Connection string field will be
enabled, and you must provide a libpq-style connection string.
• Use the Database drop-down to select the database on which the job step will be performed.
• Use the Connection string field to specify a libpq-style connection string to the remote server on which the
step will be performed. For more information about writing a connection string, please see the PostgreSQL
documentation.
• Use the On error drop-down to specify the behavior of pgAgent if it encounters an error while executing the
step. Select from:
– Fail - Stop the job if you encounter an error while processing this step.
Use the context-sensitive field on the step definition dialog’s Code tab to provide the SQL code or batch script that
will be executed during the step:
• If the step invokes SQL code, provide one or more SQL statements in the SQL query field.
• If the step performs a batch script, provide the script in the Script field. If you are running on a Windows server,
standard batch file syntax must be used. When running on a Linux server, any shell script may be used, provided
that a suitable interpreter is specified on the first line (e.g. #!/bin/sh).
When you’ve provided all of the information required by the step, click the compose icon to close the step definition
dialog. Click the add icon (+) to add each additional step, or select the Schedules tab to define the job schedule.
Click the Add icon (+) to add a schedule for the job; then click the compose icon (located at the left side of the header)
to open the schedule definition dialog:
Use the fields on the schedule definition tab to specify the days and times at which the job will execute.
• Provide a name for the schedule in the Name field.
• Use the Enabled switch to indicate that pgAgent should use the schedule (Yes) or to disable the schedule (No).
• Use the calendar selector in the Start field to specify the starting date and time for the schedule.
• Use the calendar selector in the End field to specify the ending date and time for the schedule.
• Use the Comment field to provide a comment about the schedule.
Select the Repeat tab to define the days on which the schedule will execute.
Use the fields on the Repeat tab to specify the details about the schedule in a cron-style format. The job will execute
on each date or time element selected on the Repeat tab.
Click within a field to open a list of valid values for that field; click on a specific value to add that value to the list of
selected values for the field. To clear the values from a field, click the X located at the right-side of the field.
Use the fields within the Days box to specify the days on which the job will execute:
• Use the Week Days field to select the days on which the job will execute.
• Use the Month Days field to select the numeric days on which the job will execute. Specify the Last Day to
indicate that the job should be performed on the last day of the month, irregardless of the date.
• Use the Months field to select the months in which the job will execute.
Use the fields within the Times box to specify the times at which the job will execute:
• Use the Hours field to select the hour at which the job will execute.
• Use the Minutes field to select the minute at which the job will execute.
Select the Exceptions tab to specify any days on which the schedule will not execute.
Use the fields on the Exceptions tab to specify days on which you wish the job to not execute; for example, you may
wish for jobs to not execute on national holidays.
Click the Add icon (+) to add a row to the exception table, then:
• Click within the Date column to open a calendar selector, and select a date on which the job will not execute.
Specify <Any> in the Date column to indicate that the job should not execute on any day at the time selected.
• Click within the Time column to open a time selector, and specify a time on which the job will not execute.
Specify <Any> in the Time column to indicate that the job should not execute at any time on the day selected.
When you’ve finished defining the schedule, you can use the SQL tab to review the code that will create or modify
your job.
Click the Save button to save the job definition, or Cancel to exit the job without saving. Use the Reset button to
remove your unsaved entries from the dialog.
After saving a job, the job will be listed under the pgAgent Jobs node of the pgAdmin tree control of the server on
which it was defined. The Properties tab in the main pgAdmin window will display a high-level overview of the
selected job, and the Statistics tab will show the details of each run of the job.
To modify an existing job or to review detailed information about a job, right-click on a job name, and select Properties
from the context menu.
pgAdmin is an open-source project that invites you to get involved in the development process. For more infor-
mation about contributing to the pgAdmin project, contact the developers on the pgAdmin mailing list pgadmin-
[email protected] to discuss any ideas you might have for enhancements or bug fixes.
In the following sections, you’ll find detailed information about the development process used to develop, improve,
and maintain the pgAdmin client.
Before developing a patch for pgAdmin you should always contact the developers on the mailing list pgadmin-
[email protected] to discuss your plans. This ensures that others know if you’re fixing a bug and can then
avoid duplicating your work, and in the case of large patches, gives the community the chance to discuss and refine
your ideas before investing too much time writing code that may later be rejected.
You should always develop patches against a checkout of the source code from the GIT source code repository, and not
a release tarball. This ensures that you’re working with the latest code on the branch and makes it easier to generate
patches correctly. You can checkout the source code with a command like:
Once you’ve made the changes you wish to make, commit them to a private development branch in your local repos-
itory. Then create a patch containing the changes in your development branch against the upstream branch on which
your work is based. For example, if your current branch contains your changes, you might run:
to create a patch between your development branch and the public master branch.
You can also create patches directly from the development tree, for example:
327
pgAdmin 4 Documentation, Release 4.25
If you are adding new files, you may need to stage them for commit, and then create your patch against the staging
area. If any of the files are binary, for example, images, you will need to use the –binary option:
$ git add file1.py file2.py images/image1.png [...]
$ git diff --cached --binary > my_cool_feature.diff
Once you have your patch, check it thoroughly to ensure it meets the pgAdmin Coding Standards, and review it against
the Code Review Notes to minimise the chances of it being rejected. Once you’re happy with your work, mail it as an
attachment to the mailing list [email protected]. Please ensure you include a full description of what
the patch does, as well as the rationale for any important design decisions.
The bulk of pgAdmin is a Python web application written using the Flask framework on the backend, and HTML5
with CSS3, Bootstrap and jQuery on the front end. A desktop runtime is also included for users that prefer a desktop
application to a web application, which is written in C++ using the QT framework.
10.2.1 Runtime
The runtime is essentially a Python webserver and browser in a box. Found in the /runtime directory in the source
tree, it is a relatively simple QT application that is most easily modified using the QT Creator application.
The web application forms the bulk of pgAdmin and can be found in the /web directory in the source tree. The
main file is pgAdmin4.py which can be used to run the built-in standalone web server, or as a WSGI application for
production use.
Configuration
The core application configuration is found in config.py. This file includes all configurable settings for the application,
along with descriptions of their use. It is essential that various settings are configured prior to deployment on a web
server; these can be overridden in config_local.py or config_system.py (see the config.py documentation) to avoid
modifying the main configuration file.
User Settings
When running in desktop mode, pgAdmin has a single, default user account that is used for the desktop user. When
running in server mode, there may be unlimited users who are required to login prior to using the application. pgAdmin
utilised the Flask-Security module to manage application security and users, and provides options for self-service
password reset and password changes etc.
Whether in desktop or server mode, each user’s settings are stored in a SQLite database which is also used to store the
user accounts. This is initially created using the setup.py script which will create the database file and schema within
it, and add the first user account (with administrative privileges) and a default server group for them. A settings table
is also used to store user configuration settings in a key-value fashion. Although not required, setting keys (or names)
are typically formatted using forward slashes to artificially namespace values, much like the pgAdmin 3 settings files
on Linux or Mac.
Note that the local configuration must be setup prior to setup.py being run. The local configuration will determine
how the script sets up the database, particularly with regard to desktop vs. server mode.
The heart of pgAdmin is the pgadmin package. This contains the globally available HTML templates used by the Jinja
engine, as well as any global static files such as images, Javascript and CSS files that are used in multiple modules.
The work of the package is handled in it’s constructor, __init__.py. This is responsible for setting up logging and
authentication, dynamically loading other modules, and a few other tasks.
10.2.4 Modules
Units of functionality are added to pgAdmin through the addition of modules. Theses are Python object instance of
classes, inherits the PgAdminModule class (a Flask Blueprint implementation), found in web/pgadmin/utils.py. It
provide various hook points for other modules to utilise (primarily the default module - the browser).
To be recognised as a module, a Python package must be created. This must:
1) Be placed within the web/pgadmin/ directory, and
2) Implements pgadmin.utils.PgAdminModule class
3) An instance variable (generally - named blueprint) representing that particular class in that package.
Each module may define a template and static directory for the Blueprint that it implements. To avoid name collisions,
templates should be stored under a directory within the specified template directory, named after the module itself.
For example, the browser module stores it’s templates in web/pgadmin/browser/templates/browser/. This does not
apply to static files which may omit the second module name.
In addition to defining the Blueprint, the views module is typically responsible for defining all the views that will
be rendered in response to client requests, we must provide a REST API url(s) for these views. These must include
appropriate route and security decorators. Take a look at the NodeView class, which uses the same approach as
Flask’s MethodView, it can be found in web/pgadmin/browser/utils.py. This specific class is used by browser nodes
for creating REST API url(s) for different operation on them. i.e. list, create, update, delete, fetch children, get
statistics/reversed SQL/dependencies/dependents list for that node, etc. We can use the same class for other purpose
too. You just need to inherit that class, and overload the member variables operations, parent_ids, ids, node_type, and
then register it as node view with PgAdminModule instance.
Most pgAdmin modules will also implement the hooks provided by the PgAdminModule class. This is responsible
for providing hook points to integrate the module into the rest of the application - for example, a hook might tell the
caller what CSS files need to be included on the rendered page, or what menu options to include and what they should
do. Hook points need not exist if they are not required. It is the responsibility of the caller to ensure they are present
before attempting to utilise them.
Hooks currently implemented are:
class MyModule(PgAdminModule):
"""
This is class implements the pgadmin.utils.PgAdminModule, and
implements the hooks
"""
...
def get_own_stylesheets(self):
"""
Returns:
list: the stylesheets used by this module, not including any
stylesheet needed by the submodules.
"""
(continues on next page)
def get_own_javascripts(self):
"""
Returns:
list of dict:
- contains the name (representation for this javascript
module), path (url for it without .js suffix), deps (array of
dependents), exports window object by the javascript module,
and when (would you like to load this javascript), etc
information for this module, not including any script needed
by submodules.
"""
return [
{
'name': 'pgadmin.extension.mymodule',
'path': url_for('static', filename='js/mymodule'),
'exports': None,
'when': 'server'
}
]
def get_own_menuitems(self):
"""
Returns:
dict: the menuitems for this module, not including
any needed from the submodules.
"""
return {
'help_items': [
MenuItem(
name='mnu_mymodule_help',
priority=999,
# We need to create javascript, which registers itself
# as module
module="pgAdmin.MyModule",
callback='about_show',
icon='fa fa-info-circle',
label=gettext('About MyModule'
)
]
}
def get_panels(self):
"""
Returns:
list: a list of panel objects to add implemented in javascript
module
"""
return []
...
pgAdmin Modules may include any additional Python modules that are required to fulfill their purpose, as required.
They may also reference other dynamically loaded modules, but must use the defined hook points and fail gracefully
10.2.5 Nodes
Nodes are very similar to modules, it represents an individual node or, collection object on the browser treeview. To
recognised as a node module, a Python package (along with javascript modules) must be created. This must:
1) Be placed within the web/pgadmin/browser/ directory, and
2) Implements the BrowserPluginModule, and registers the node view, which exposes required the REST APIs
3) An instance of the class object
pgAdmin uses javascript extensively for the front-end implementation. It uses require.js to allow the lazy loading (or,
say load only when required), bootstrap for UI look and feel, Backbone for data manipulation of a node, Backform
for generating properties/create dialog for selected node. We have divided each module in small chunks as much as
possible. Not all javascript modules are required to be loaded (i.e. loading a javascript module for database will make
sense only when a server node is loaded completely.) Please look at the the javascript files node.js, browser.js, menu.js,
panel.js, etc for better understanding of the code.
pgAdmin uses multiple technologies and multiple languages, each of which have their own coding standards.
10.3.1 General
In all languages, indentations should be made with 4 spaces, and excessively long lines wrapped where appropriate to
ensure they can be read on smaller displays (80 characters is used in many places, but this is not a required maximum
size as it’s quite wasteful on modern displays). Typically lines should not be longer than 120 characters.
Comments should be included in all code where required to explain its purpose or how it works if not obvious from a
quick review of the code itself.
10.3.2 CSS 3
CSS3 is used for styling and layout throughout the application. Extensive use is made of the Bootstrap Framework to
aid in that process, however additional styles must still be created from time to time.
Most custom styling comes from individual modules which may advertise static stylesheets to be included in the
module that is loading them via hooks.
Styling overrides (for example, to alter the Bootstrap look and feel) will typically be found in the overrides.css file in
the main static file directory for the application.
Styling should never be applied inline in HTML, always through an external stylesheet, which should contain com-
ments as appropriate to explain the usage or purpose for the style.
Styles should be specified clearly, one per line. For example:
/* Ensure the codemirror editor displays full height gutters when resized */
.CodeMirror, .CodeMirror-gutters {
height: 100% !important;
}
10.3.3 HTML 5
HTML 5 is used for page structure throughout the application, in most cases being rendered from templates by the
Jinja2 template engine in Flask.
All HTML must be HTML 5 compliant.
10.3.4 Javascript
Client-side code is written in Javascript using jQuery and various plugins. Whilst much of the code is rendered
from static files, there is also code that is rendered from templates using Jinja2 (often to inject the users settings) or
constructed on the fly from module hooks.
A typical Javascript function might be formatted like this (this snipped is from a template):
function() {
var id = tree.getId(item)
$.post("{{ url_for('NODE-server-group.delete') }}", { id: id })
.done(function(data) {
if (data.success == 0) {
report_error(data.errormsg, data.info);
} else {
var next = tree.next(item);
var prev = tree.prev(item);
tree.remove(item);
if (next.length) {
tree.select(next);
} else if (prev.length) {
tree.select(prev);
}
}
}
)
},
null
)
}
Note the use of a descriptive function name, using the underscore character to separate words in all lower case, and
short but descriptive lower case variable names.
Note: From version 3.0 onwards, new or refactored code should be written using ES6 features and conventions.
10.3.5 C++
C++ code is used in the desktop runtime for the application, primarily with the QT framework and an embedded
Python interpreter. Note the use of hanging braces, which may be omitted if on a single statement is present:
url.setPath("/utils/ping");
do
{
reply = manager.get(QNetworkRequest(url));
redirectUrl = reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
url = redirectUrl.toUrl();
if (!redirectUrl.isNull())
delete reply;
} while (!redirectUrl.isNull());
if (reply->error() != QNetworkReply::NoError)
return false;
if (response != "PING")
{
qDebug() << "Failed to connect, server response: " << response;
return false;
}
return true;
}
10.3.6 Python
Python is used for the backend web server. All code must be compatible with Python 2.7 and should include PyDoc
comments whilst following the official Python coding standards defined in PEP 8. An example function along with
the required file header is shown below:
##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2020, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
##########################################################################
def get_nodes():
"""Return a JSON document listing the server groups for the user"""
groups = ServerGroup.query.filter_by(user_id=current_user.id)
value = ''
for group in groups:
value += '{"id":%d,"label":"%s","icon":"icon-server-group","inode":true},' \
% (group.id, group.name)
value = value[:-1]
return value
This document contains code for some of the important classes, listed as below:
• PgAdminModule
• NodeView
• BaseDriver
• BaseConnection
10.4.1 PgAdminModule
PgAdminModule is inherited from Flask.Blueprint module. This module defines a set of methods, properties and
attributes, that every module should implement.
class PgAdminModule(Blueprint):
"""
Base class for every PgAdmin Module.
def create_module_preference():
# Create preference for each module by default
if hasattr(self, 'LABEL'):
self.preference = Preferences(self.name, self.LABEL)
else:
self.preference = Preferences(self.name, None)
self.register_preferences()
# Create and register the module preference object and preferences for
# it just before the first request
self.before_app_first_request(create_module_preference)
def register_preferences(self):
# To be implemented by child classes
pass
def get_own_stylesheets(self):
"""
Returns:
(continues on next page)
def get_own_messages(self):
"""
Returns:
dict: the i18n messages used by this module, not including any
messages needed by the submodules.
"""
return dict()
def get_own_javascripts(self):
"""
Returns:
list: the javascripts used by this module, not including
any script needed by the submodules.
"""
return []
def get_own_menuitems(self):
"""
Returns:
dict: the menuitems for this module, not including
any needed from the submodules.
"""
return defaultdict(list)
def get_panels(self):
"""
Returns:
list: a list of panel objects to add
"""
return []
def get_exposed_url_endpoints(self):
"""
Returns:
list: a list of url endpoints exposed to the client.
"""
return []
@property
def stylesheets(self):
stylesheets = self.get_own_stylesheets()
for module in self.submodules:
stylesheets.extend(module.stylesheets)
return stylesheets
@property
def messages(self):
res = self.get_own_messages()
@property
def javascripts(self):
javascripts = self.get_own_javascripts()
for module in self.submodules:
javascripts.extend(module.javascripts)
return javascripts
@property
def menu_items(self):
menu_items = self.get_own_menuitems()
for module in self.submodules:
for key, value in module.menu_items.items():
menu_items[key].extend(value)
menu_items = dict((key, sorted(value, key=attrgetter('priority')))
for key, value in menu_items.items())
return menu_items
@property
def exposed_endpoints(self):
res = self.get_exposed_url_endpoints()
return res
10.4.2 NodeView
The NodeView class exposes basic REST APIs for different operations used by the pgAdmin Browser. The basic idea
has been taken from Flask’s MethodView class. Because we need a lot more operations (not, just CRUD), we can not
use it directly.
class NodeView(with_metaclass(MethodViewType, View)):
"""
A PostgreSQL Object has so many operaions/functions apart from CRUD
(Create, Read, Update, Delete):
i.e.
- Reversed Engineered SQL
- Modified Query for parameter while editing object attributes
i.e. ALTER TABLE ...
- Statistics of the objects
- List of dependents
- List of dependencies
- Listing of the children object types for the certain node
It will used by the browser tree to get the children nodes
This class can be inherited to achieve the diffrent routes for each of the
object types/collections.
NOTE:
Parent URL can be seen as the path to identify the particular node.
i.e.
In order to identify the TABLE object, we need server -> database -> schema
information.
"""
operations = dict({
'obj': [
{'get': 'properties', 'delete': 'delete', 'put': 'update'},
{'get': 'list', 'post': 'create'}
],
'nodes': [{'get': 'node'}, {'get': 'nodes'}],
'sql': [{'get': 'sql'}],
'msql': [{'get': 'modified_sql'}],
'stats': [{'get': 'statistics'}],
'dependency': [{'get': 'dependencies'}],
'dependent': [{'get': 'dependents'}],
'children': [{'get': 'children'}]
})
@classmethod
def generate_ops(cls):
cmds = []
for op in cls.operations:
idx = 0
for ops in cls.operations[op]:
meths = []
for meth in ops:
meths.append(meth.upper())
if len(meths) > 0:
cmds.append({
'cmd': op, 'req': (idx == 0),
'with_id': (idx != 2), 'methods': meths
})
idx += 1
return cmds
@classmethod
def get_node_urls(cls):
assert cls.node_type is not None, \
"Please set the node_type for this class ({0})".format(
str(cls.__class__.__name__))
common_url = '/'
for p in cls.parent_ids:
common_url += '<{0}:{1}>/'.format(str(p['type']), str(p['id']))
id_url = None
for p in cls.ids:
id_url = '{0}<{1}:{2}>'.format(
common_url if not id_url else id_url,
p['type'], p['id'])
for p in self.ids:
if p['id'] not in kwargs:
has_id = False
break
assert (
self.cmd in self.operations and
(has_id and len(self.operations[self.cmd]) > 0 and
(continues on next page)
if method is None:
return make_json_response(
status=406,
success=0,
errormsg=gettext(
'Unimplemented method ({0}) for this url ({1})').format(
meth, flask.request.path
)
)
@classmethod
def register_node_view(cls, blueprint):
cls.blueprint = blueprint
id_url, url = cls.get_node_urls()
commands = cls.generate_ops()
for c in commands:
cmd = c['cmd'].replace('.', '-')
if c['with_id']:
blueprint.add_url_rule(
'/{0}{1}'.format(
c['cmd'], id_url if c['req'] else url
),
view_func=cls.as_view(
'{0}{1}'.format(
cmd, '_id' if c['req'] else ''
),
cmd=c['cmd']
),
methods=c['methods']
)
else:
blueprint.add_url_rule(
'/{0}'.format(c['cmd']),
(continues on next page)
:param args:
:param kwargs: Parameters to generate the correct set of tree node.
:return: List of the children nodes
"""
children = []
return children
10.4.3 BaseDriver
class BaseDriver(object):
"""
class BaseDriver(object):
Abstract Properties:
-------- ----------
* Version (string):
Current version string for the database server
* libpq_version (string):
Current version string for the used libpq library
Abstract Methods:
-------- -------
(continues on next page)
* release_connection(*args, **kwargs)
- Implement the connection release logic
* gc()
- Implement this function to release the connections assigned in the
session, which has not been pinged from more than the idle timeout
configuration.
"""
@abstractproperty
def version(cls):
pass
@abstractproperty
def libpq_version(cls):
pass
@abstractmethod
def get_connection(self, *args, **kwargs):
pass
@abstractmethod
def release_connection(self, *args, **kwargs):
pass
@abstractmethod
def gc_timeout(self):
pass
10.4.4 BaseConnection
class BaseConnection(object):
"""
class BaseConnection(object)
Abstract Methods:
-------- -------
* connect(**kwargs)
- Define this method to connect the server using that particular driver
implementation.
* connected()
- Implement this method to get the status of the connection. It should
return True for connected, otherwise False
* reset()
- Implement this method to reconnect the database server (if possible)
* transaction_status()
- Implement this method to get the transaction status for this
connection. Range of return values different for each driver type.
* ping()
- Implement this method to ping the server. There are times, a connection
has been lost, but - the connection driver does not know about it. This
can be helpful to figure out the actual reason for query failure.
* _release()
- Implement this method to release the connection object. This should not
be directly called using the connection object itself.
* _wait(conn)
- Implement this method to wait for asynchronous connection to finish the
execution, hence - it must be a blocking call.
* _wait_timeout(conn, time)
- Implement this method to wait for asynchronous connection with timeout.
This must be a non blocking call.
* poll(formatted_exception_msg, no_result)
- Implement this method to poll the data of query running on asynchronous
(continues on next page)
* cancel_transaction(conn_id, did=None)
- Implement this method to cancel the running transaction.
* messages()
- Implement this method to return the list of the messages/notices from
the database server.
* rows_affected()
- Implement this method to get the rows affected by the last command
executed on the server.
"""
ASYNC_OK = 1
ASYNC_READ_TIMEOUT = 2
ASYNC_WRITE_TIMEOUT = 3
ASYNC_NOT_CONNECTED = 4
ASYNC_EXECUTION_ABORTED = 5
ASYNC_TIMEOUT = 0.2
ASYNC_WAIT_TIMEOUT = 2
ASYNC_NOTICE_MAXLENGTH = 100000
@abstractmethod
def connect(self, **kwargs):
pass
@abstractmethod
def execute_scalar(self, query, params=None,
formatted_exception_msg=False):
pass
@abstractmethod
def execute_async(self, query, params=None,
formatted_exception_msg=True):
pass
@abstractmethod
def execute_void(self, query, params=None,
formatted_exception_msg=False):
pass
@abstractmethod
def execute_2darray(self, query, params=None,
formatted_exception_msg=False):
pass
@abstractmethod
def execute_dict(self, query, params=None,
formatted_exception_msg=False):
pass
@abstractmethod
def async_fetchmany_2darray(self, records=-1,
formatted_exception_msg=False):
pass
@abstractmethod
def reset(self):
pass
@abstractmethod
def transaction_status(self):
pass
@abstractmethod
def ping(self):
pass
@abstractmethod
def _release(self):
pass
@abstractmethod
def _wait(self, conn):
pass
@abstractmethod
def _wait_timeout(self, conn, time):
pass
@abstractmethod
def poll(self, formatted_exception_msg=True, no_result=False):
pass
@abstractmethod
def status_message(self):
pass
@abstractmethod
def rows_affected(self):
pass
@abstractmethod
def cancel_transaction(self, conn_id, did=None):
pass
This document lists a number of standard items that will be checked during the review process for any patches sub-
mitted for inclusion in pgAdmin.
• Ensure all code follows the pgAdmin Coding Standards.
• Ensure all code has unit test coverage and API/feature test coverage where appropriate.
• Copyright years must be correct and properly formatted (to make it easy to make bulk updates every year). The
start date should always be 2013, and the end year the current year, e.g.
10.6 Translations
pgAdmin supports multiple languages using the Flask-Babel Python module. A list of supported languages is included
in the web/config.py configuration file and must be updated whenever languages are added or removed with ISO 639-1
(two letter) language codes. The codes are named $LANG in this document.
Strings can be marked for translation in either Python code (using gettext()) or Jinja templates (using _()). Here are
some examples that show how this is achieved.
Python:
Jinja:
Whenever new strings are added to the application, the template catalogue (web/pgadmin/messages.pot) and the ex-
isting translation catalogues (web/pgadmin/translations/$LANG/LC_MESSAGES/messages.po) must be updated
and compiled. This can be achieved using the following commands from the web directory in the Python virtual
environment for pgAdmin:
Once the template has been updated it needs to be merged into the existing message catalogues:
Adding a new language is simple. First, add the language name and identifier to web/config.py:
Then, create the new message catalogue from the web directory in the source tree in the Python virtual environment
for pgAdmin:
Release Notes
pgAdmin release notes provide information on the features and improvements in each release. This page includes
release notes for major releases and minor (bugfix) releases. Select your version from the list below to see the release
notes for it.
Issue #3904 - Replace charting library Flotr2 with ChartJS using React.
Issue #5126 - Modified schema diff tool to compare two databases instead of two schemas.
Issue #5610 - Add a –yes command line option to setup-web.sh to allow non-interactive use.
11.1.2 Housekeeping
Issue #5324 - Improve code coverage and API test cases for Foreign Servers and User Mappings.
Issue #5327 - Improve code coverage and API test cases for Schemas.
Issue #5336 - Improve code coverage and API test cases for Types.
Issue #5700 - Remove old Python 2 compatibility code.
Issue #5731 - Upgrade font awesome from v4 to v5.
349
pgAdmin 4 Documentation, Release 4.25
Issue #3767 - Ensure that the original file format should be retained when saving the same file in SQL editor.
Issue #3791 - Added missing comments in reverse engineering SQL for each column of a View.
Issue #4123 - Fixed an issue where debugger doesn’t work if the search path is set other than ‘public’.
Issue #4361 - Fixed ssh tunnel hang issue when the user tries to disconnect the server.
Issue #4387 - Fixed an issue where the user is not able to insert the data if the table and columns name contains
special characters.
Issue #4810 - Fixed an issue where the user is not able to save the new row if the table is empty.
Issue #5429 - Ensure that the Dictionaries drop-down shows all the dictionaries in the FTS configuration dialog.
Issue #5490 - Make the runtime configuration dialog non-modal.
Issue #5526 - Fixed an issue where copying and pasting a cell with multiple line data will result in multiple rows.
Issue #5567 - Fixed an issue where conversion of bytea to the binary string results in an error.
Issue #5604 - Fixed an issue where the entire logs is in red text when the user runs backup and restore.
Issue #5632 - Ensure that the user will be able to modify the start value of the Identity column.
Issue #5646 - Ensure that RLS Policy node should be searchable using search object.
Issue #5664 - Fixed an issue where ‘ALTER VIEW’ statement is missing when the user sets the default value of a
column for View.
Issue #5670 - Fixed an issue where the error message does not have a close button on utility dialogs.
Issue #5689 - Added the ‘ORDER BY’ clause for the privileges type to fix schema diff issue.
Issue #5708 - Correct TLS certificate filename in the container deployment docs.
Issue #5710 - Fixed an issue when comparing the table with a trigger throwing error in schema diff.
Issue #5713 - Corrected DROP SQL syntax for catalog.
Issue #5716 - Fixed an issue where ajax call continues to fire even after disconnecting the database server.
Issue #5724 - Clarify some of the differences when running in server mode in the docs.
Issue #5730 - Resolve schema diff dependencies by selecting the appropriate node automatically and maintain the
order in the generated script.
Issue #5235 - Support configuration files that are external to the application installation.
Issue #5484 - Added support for LDAP authentication with different DN by setting the dedicated user for the LDAP
connection.
Issue #5583 - Added support for schema level restriction.
Issue #5601 - Added RLS Policy support in Schema Diff.
Issue #5622 - Added support for permissive/restricted policy type while creating RLS Policy.
Issue #5650 - Added support for LDAP anonymous binding.
Issue #5653 - Added High Contrast theme support.
11.2.2 Housekeeping
Issue #5323 - Improve code coverage and API test cases for Foreign Data Wrapper.
Issue #5326 - Improve code coverage and API test cases for Domain and Domain Constraints.
Issue #5329 - Improve code coverage and API test cases for FTS Configuration, FTS Parser, FTS Dictionaries, and
FTS Template.
Issue #3814 - Fixed issue of error message not getting displayed when filename is empty for backup, restore, and
import/export.
Issue #3851 - Add proper indentation to the code while generating functions, procedures, and trigger functions.
Issue #4235 - Fixed tab indent issue on a selection of lines is deleting the content when ‘use spaces == true’ in the
preferences.
Issue #5137 - Fixed save button enable issue when focusing in and out of numeric input field.
Issue #5287 - Fixed dark theme-related CSS and modify the color codes.
Issue #5414 - Use QStandardPaths::AppLocalDataLocation in the runtime to determine where to store runtime logs.
Issue #5463 - Fixed an issue where CSV download quotes numeric columns.
Issue #5470 - Fixed backgrid row hover issue where on hover background color is set for edit and delete cell only.
Issue #5530 - Ensure that the referenced table should be displayed on foreign key constraints.
Issue #5554 - Replace the runtime themes with ones that don’t have sizing issues.
Issue #5569 - Fixed reverse engineered SQL for partitions when storage parameters are specified.
Issue #5577 - Include LICENSE and DEPENDENCIES [inventory] files in official packages.
Issue #5621 - Remove extra brackets from reverse engineering SQL of RLS Policy.
Issue #5629 - Fixed an issue where the user is able to edit properties when some of the collection nodes are selected.
Issue #5630 - Fixed an issue where installation of pgadmin4 not working on 32-bit Windows.
Issue #5631 - Fixed ‘cant execute empty query’ issue when remove the value of ‘USING’ or ‘WITH CHECK’ option
of RLS Policy.
Issue #5633 - Ensure that create RLS Policy menu should not be visible for catalog objects.
Issue #5647 - Fixed an issue where difference DDL is showing the wrong SQL when changing the policy owner.
Issue #5662 - Fixed accessibility issue where few dialogs are not rendering properly when we zoomed in browser
window 200% and screen resolution is low.
Issue #5666 - Added missing dependencies/dependent and corrected some wrongly identified.
Issue #5673 - Fixed an issue where fetching the schema throws an error if the database is not connected in Schema
Diff.
Issue #5675 - Fixed CSRF errors when pgAdmin opened in an iframe on safari browser.
Issue #5677 - Fixed text color issue in explain analyze for the Dark theme.
Issue #5686 - Fixed issue where the user was not able to update policy if the policy is created with space.
Issue #5468 - Added option to ignore the whitespaces while comparing objects in schema diff.
Issue #5500 - Added server group name while selecting servers in schema diff.
Issue #5516 - Added support of Row Security Policies.
Issue #5576 - Improve error messaging if the storage and log directories cannot be created.
11.3.2 Housekeeping
Issue #5325 - Improve code coverage and API test cases for Collations.
Issue #5574 - Cleanup Windows build scripts and ensure Windows x64 builds will work.
Issue #5581 - Documentation of Row Level Security Policies.
Issue #3591 - Ensure that the query tool should display the proper error message while terminating the active session.
Issue #3669 - Ensure that proper error should be displayed for the deleted node.
Issue #3787 - Disabled the Stop process button after clicking it and added a message ‘Terminating the process. . . ’ to
notify the user.
Issue #4226 - Fixed an issue where select all checkbox only selects the first 50 tables.
Issue #5416 - Ensure that the query tool panel gets closed when clicking on the ‘Don’t Save’ button.
Issue #5465 - Fixed an issue where the Edge browser version is showing wrong and warning message gets displayed.
Issue #5492 - Fixed an issue where the search object is unable to locate inherited tables and constraint filters are not
working.
Issue #5507 - Fixed connection and version number detection issue when the database server is upgraded.
Issue #5521 - Fixed an issue when dumping servers from a desktop pgAdmin app by providing an option
‘–sqlite-path’.
Issue #5539 - Fixed typo in exception keyword.
Issue #5584 - Fixed an issue where two identical tables showing different by schema diff tool.
Issue #5592 - Ensure that pgadmin should be able to connect to the server which has password more than 1000
characters.
Issue #5452 - Added connected pgAdmin user and connection name in the log file.
Issue #5489 - Show the startup log as well as the server log in the runtime’s log viewer.
11.4.2 Housekeeping
Issue #5255 - Implement Selenium Grid to run multiple tests across different browsers, operating systems, and
machines in parallel.
Issue #5333 - Improve code coverage and API test cases for Indexes.
Issue #5334 - Improve code coverage and API test cases for the Rules module.
Issue #5335 - Improve code coverage and API test cases for Triggers and Compound Triggers.
Issue #5443 - Remove support for Python 2.
Issue #5444 - Cleanup Python detection in the runtime project file.
Issue #5455 - Refactor pgAdmin4.py so it can be imported and is a lot more readable.
Issue #5493 - Search object UI improvements.
Issue #5525 - Cleanup and refactor the macOS build scripts.
Issue #5552 - Update dependencies in the Docker container.
Issue #5553 - Remove PG 9.4 utilities from the Docker container as it’s now out of support.
Issue #3694 - Gracefully informed the user that the database is already connected when they click on “Connect
Database. . . ”.
Issue #4033 - Fixed an issue where clicking on the cross button of the alert box on the login page is not working.
Issue #4099 - Fixed the SQL help issue for EDB Postgres Advanced Server.
Issue #4223 - Ensure that maintenance job should be worked properly for indexes under a materialized view.
Issue #4279 - Ensure that file browse “home” button should point to $HOME rather than /.
Issue #4840 - Ensure that ‘With OID’ option should be disabled while taking backup of database server version 12
and above.
Issue #5001 - Fixed invalid literal issue when removing the connection limit for the existing role.
Issue #5052 - Fixed internal server error when clicking on Triggers -> ‘Enable All’ for partitions.
Issue #5398 - Fixed generated SQL issue for auto vacuum options.
Issue #5422 - Ensure that the dependencies tab shows correct information for Synonyms.
Issue #5434 - Fixed an issue where the newly added table is not alphabetically added to the tree.
Issue #5440 - Fixed list sorting issue in the schema diff tool.
Issue #5449 - Fixed an issue while comparing the two identical schemas using the schema diff tool.
Issue #5450 - Fixed an issue when renaming the column not added in the proper order.
Issue #5466 - Correct ipv4 “all interfaces” address in the container docs, per Frank Limpert.
Issue #5469 - Fixed an issue where select2 hover is inconsistent for the SSL field in create server dialog.
Issue #5473 - Fixed post-login redirect location when running in server mode under a non-default root.
Issue #5480 - Fixed an issue where the background job creation fails if there is only a version-specific python binary
available in PATH.
Issue #5481 - Fixed data truncation issue when updating the data of type character with length.
Issue #5487 - Fixed an issue where if LDAP_SEARCH_BASE_DN is not set then, the value for LDAP_BASE_DN
will be considered.
Issue #5496 - Fixed an issue where clicking on Select All button, not selecting all the options in pgAgent job
scheduler.
Issue #5503 - Clarify and correct the docs on enabling the pl/debugger plugin on the server.
Issue #5510 - Fixed Unicode decode error ‘utf-8’ codec can’t decode byte.
11.5.2 Housekeeping
Issue #4620 - Add Reverse Engineered and Modified SQL tests for procedures.
Issue #4623 - Add Reverse Engineered and Modified SQL tests for pgAgent jobs.
Issue #1257 - Ensure all object types have a “System XXX?” property.
Issue #2813 - Ensure that the password prompt should not be visible if the database server is in trust authentication
mode.
Issue #3495 - Fixed an issue where the query tool unable to load the file which contains the BOM marker.
Issue #3523 - Fixed an issue where right-clicking a browser object does not apply to the object on which right-click
was fired.
Issue #3645 - Ensure that the start and end date should be deleted when clear the selection for pgAgent Job.
Issue #3900 - Added multiple drop/delete functionality for the table constraints.
Issue #3947 - Fixed copy-paste row issues in View/Edit Data.
Issue #3972 - Modified keyboard shortcuts in Query Tool for OSX native support.
Issue #3988 - Fixed cursor disappeared issue in the query editor for some of the characters when zoomed out.
Issue #4180 - Fixed mouse click issue where it does not select an object in Browser unless the pointer is over the
object.
Issue #4206 - Ensure that the grant wizard should be closed on pressing the ESC key.
Issue #4292 - Added dark mode support for the configuration dialog on Windows/macOS runtime.
Issue #4440 - Ensure the DROP statements in reverse engineered SQL are properly quoted for all objects.
Issue #4445 - Ensure all object names in the title line of the reverse-engineered SQL are not quoted.
Issue #4504 - Fixed an issue where like options should be disabled if the relation is not selected while creating a table.
Issue #4512 - Fixed calendar opening issue on the exception tab inside the schedules tab of pgAgent.
Issue #4545 - Fixed an issue wherein grant wizard the last object is not selectable.
Issue #4573 - Ensure that if the delimiter is set other than comma then download the file as ‘.txt’ file.
Issue #4684 - Fixed encoding issue while saving data in encoded charset other than ‘utf-8’.
Issue #4709 - Added schema-qualified dictionary names in FTS configuration to avoid confusion of duplicate names.
Issue #4856 - Enable the save button by default when a query tool is opened with CREATE or other scripts.
Issue #4858 - Fixed python exception error when user tries to download the CSV and there is a connection issue.
Issue #4864 - Make the configuration window in runtime to auto-resize.
Issue #4873 - Fixed an issue when changing the comments of the procedure with arguments gives error in case of
overloading.
Issue #4946 - Fixed an issue when the user creates a temporary table with ‘on commit drop as’ clause.
Issue #4957 - Ensure that Constraint Trigger, Deferrable, Deferred option should be disabled when the user selects
EDB-SPL function for the trigger.
Issue #4969 - Fixed an issue where changing the values of columns with JSONB or JSON types to NULL.
Issue #5007 - Ensure index dropdown should have existing indexes while creating unique constraints.
Issue #5043 - Fixed an issue where columns names should be visible in the order of their creation in the browser tree.
Issue #5053 - Fixed an issue where changing the columns in the existing view throws an error.
Issue #5157 - Ensure that default sort order should be using the primary key in View/Edit data.
Issue #5180 - Fixed an issue where the autovacuum_enabled parameter is added automatically in the RE-SQL when
the table has been created using the WITH clause.
Issue #5210 - Ensure that text larger than underlying field size should not be truncated automatically.
Issue #5213 - Fixed an issue when the user performs refresh on a large size materialized view.
Issue #5227 - Fixed an issue where user cannot be added if many users are already exists.
Issue #5268 - Fixed generated SQL when any token in FTS Configuration or any option in FTS Dictionary is
changed.
Issue #5270 - Ensure that OID should be shown in properties for Synonyms.
Issue #5275 - Fixed tab key navigation issue for parameters in table dialog.
Issue #5302 - Fixed an issue where difference SQL is not seen in the schema diff tool for Types.
Issue #5314 - Ensure that switch cell is in sync with switch control for accessibility.
Issue #5315 - Fixed an issue where schema diff showing changes in the identical domain constraints.
Issue #5350 - Fixed an issue where schema diff marks an identical table as different.
Issue #5351 - Fixed compilation warnings while building pgAdmin.
Issue #5352 - Fixed the rightmost and bottom tooltip crop issues in the explain query plan.
Issue #5356 - Fixed modified SQL issue while adding an exception in pgAgent job schedule.
Issue #5361 - Fixes an issue where pgAdmin4 GUI does not display properly in IE 11.
Issue #5362 - Fixed an issue where the identical packages and sequences visible as different in the schema diff tool.
Issue #5366 - Added alert message to Reset Layout if any of the panels from Query Tool failed to load.
Issue #5371 - Fixed tab key navigation for some dialogs.
Issue #5375 - Fixed an issue where the Mode cell of argument grid does not appear completely in the Functions
dialog.
Issue #5383 - Fixed syntax error while refreshing the existing synonyms.
Issue #5387 - Fixed an issue where the mode is not shown in the properties dialog of functions/procedures if all the
arguments are “IN” arguments.
Issue #5396 - Fixed an issue where the search object module unable to locate the object in the browser tree.
Issue #5400 - Fixed internal server error when the database server is logged in with non-super user.
Issue #5401 - Fixed search object issue when the object name contains special characters.
Issue #5402 - Fixed an issue where the checkbox is not visible on Configuration dialog in runtime for the dark theme.
Issue #5409 - Fixed validation issue in Synonyms node.
Issue #5410 - Fixed an issue while removing the package body showing wrong modified SQL.
Issue #5415 - Ensure that the query tool context menu should work on the collection nodes.
Issue #5419 - Ensure that the user should not be able to change the authentication source.
Issue #5420 - Ensure error should be handled properly when LDAP user is created with the same name.
Issue #5430 - Added title to the login page.
Issue #5432 - Fixed an issue where an internal user is not created if the authentication source is set to internal and
ldap.
Issue #5439 - Fixed an issue where the user is not able to create a server if login with an LDAP account.
Issue #5441 - Fixed an issue where the search object not able to locate pg_toast_* tables in the pg_toast schema.
Issue #5447 - Fixed failed to fetch utility error when click on refresh(any option) materialized view.
Issue #5261 - Added support of Collation, FTS Configuration, FTS Dictionary, FTS Parser and FTS Template to the
Schema Diff.
Issue #5262 - Added support of Domain, Domain Constraints and Types to the Schema Diff.
11.6.2 Housekeeping
Issue #5271 - Enhance the color of switch control for both light and dark theme.
Issue #5284 - Added and fixed gettext usage for better translation coverage.
Issue #4237 - Fix an issue where the user can not change the value of DateTime picker control using keyboard.
Issue #4608 - Fixed some accessibility issues in the dialogs.
Issue #4942 - Fixed chrome driver download utility issue for Ubuntu.
Issue #5128 - Change some colors and opacity to comply with WCAG color contrast standards.
Issue #5143 - Fix an accessibility issue to maximize the panel for all alertify dialog.
Issue #5221 - Improve logic to get the DDL statements as a part of the comparison.
Issue #5241 - Fixed tab key navigation issue for Grant Wizard.
Issue #5279 - Fixed Unicode character issue causing error on Python2 environment.
Issue #5292 - Fixed focus color issue for Alertify dialog buttons.
11.7.2 Housekeeping
Issue #5088 - Improve code coverage and API test cases for the Event Trigger module.
Issue #5133 - Improvements in the UI for both default and dark themes.
Issue #5176 - Enhance logging by tracking stdout and stderr of subprocess when log level set to DEBUG.
Issue #5185 - Added option to override the class name of a label tag for select2 control.
Issue #4955 - Changed the color of selected and hovered item for Select2 dropdown.
Issue #4996 - Improve the style of the highlighted code after query execution for Dark mode.
Issue #5058 - Ensure that AlertifyJS should not be visible as a title for alert dialog.
Issue #5077 - Changed background pattern for geometry viewer to use #fff for all themes.
Issue #5101 - Fix an issue where debugger not showing all arguments anymore after hitting SQL error while
debugging.
Issue #5107 - Set proper focus on tab navigation for file manager dialog.
Issue #5115 - Fix an issue where command and statements were parsed incorrectly for Rules.
Issue #5142 - Ensure that all the transactions should be canceled before closing the connections when a server is
disconnected using pgAdmin.
Issue #5184 - Fixed Firefox monospaced issue by updating the font to the latest version.
Issue #5214 - Update Flask-SQLAlchemy and SQLAlchemy package which is not working on Windows with Python
3.8.
Issue #5215 - Fix syntax error when changing the event type for the existing rule.
11.8.2 Housekeeping
Issue #5049 - Improve code coverage and API test cases for the CAST module.
Issue #5050 - Improve code coverage and API test cases for the LANGUAGE module.
Issue #5071 - Improve the test framework to run for multiple classes defined in a single file.
Issue #5072 - Updated wcDocker package which includes aria-label accessibility improvements.
Issue #5096 - Replace node-sass with sass for SCSS compilation.
Issue #3812 - Ensure that path file name should not disappear when changing ext from the dropdown in file explorer
dialog.
Issue #4410 - Fixed an issue while editing char[] or character varying[] column from View/Edit data throwing an
error.
Issue #4511 - Fixed an issue where Grant wizard unable to handle multiple objects when the query string
parameter exceeds its limit.
Issue #4601 - Added tab navigation on close buttons for all the panels and create/properties dialog.
Issue #4827 - Fix column resizable issue in the file explorer dialog.
Issue #5000 - Logout the pgAdmin session when no user activity of mouse move, click or keypress.
Issue #5025 - Fix an issue where setting STORAGE_DIR to empty should show all the volumes on Windows in
server mode.
Issue #5065 - Updated the incorrect icon used for the cast node on refresh.
Issue #5066 - Fix an issue where refreshing a package results in the change in the object completely.
Issue #5074 - Fix an issue where select, insert and update scripts on tables throwing an error.
Issue #5076 - Ensure Postfix starts in the container, now it runs as non-root by default.
Issue #5116 - Fixed an issue where Save Password control disappears after clicking on it while creating a server.
11.9.2 Housekeeping
Issue #4198 - Fix syntax highlighting in code mirror for backslash and escape constant.
Issue #4506 - Fix an issue where clicking on an empty textbox like fill factor or comments, considers it as change and
enabled the save button.
Issue #4633 - Added support to view multilevel partitioned tables.
Issue #4842 - Ensure that constraints, indexes, rules, triggers, and compound triggers should be created on partitions.
Issue #4943 - Added more information to the ‘Database connected/disconnected’ message.
Issue #4950 - Ensure that the user should be able to select/modify tablespace for the partitioned table on v12 and
above.
Issue #4999 - Rename some internal environment variables that could conflict with Kubernetes.
Issue #5004 - Fix vulnerability issues reported by ‘yarn audit’. Replace the deprecated uglifyjs-webpack-plugin with
a terser-webpack-plugin.
Issue #5008 - Ensure that the error message should not be displayed if Tablespace is not selected while creating the
index.
Issue #5009 - Fix an issue where operator, access method and operator class is not visible for exclusion constraints.
Issue #5013 - Add a note to the documentation about the use of non-privileged ports on filesystems that don’t support
extended attributes when running the container.
Issue #5047 - Added tab navigation for tabs under explain panel in query tool.
Issue #5068 - Fix an issue where the table is not created with autovacuum_enabled and toast.autovacuum_enabled for
PG/EPAS 12.
Warning: Warning: This release includes a change to the container distribution to run pgAdmin as a non-root user.
Those users of the container who are running with mapped storage directories may need to change the ownership
on the host machine, for example:
sudo chown -R 5050:5050 <host_directory>
Issue #4396 - Warn the user on changing the definition of Materialized View about the loss of data and its dependent
objects.
Issue #4435 - Allow drag and drop functionality for all the nodes under the database node, excluding collection nodes.
Issue #4711 - Use a ‘play’ icon for the Execute Query button in the Query Tool for greater consistency with other
applications.
Issue #4772 - Added aria-label to provide an invisible label where a visible label cannot be used.
Issue #4773 - Added role=”status” attribute to all the status messages for accessibility.
Issue #4939 - Run pgAdmin in the container as a non-root user (pgadmin, UID: 5050)
Issue #4944 - Allow Gunicorn logs in the container to be directed to a file specified through
GUNICORN_ACCESS_LOGFILE.
Issue #4990 - Changed the open query tool and data filter icons.
11.10.2 Housekeeping
Issue #4696 - Add Reverse Engineered and Modified SQL tests for Materialized Views.
Issue #4807 - Refactored code of table and it’s child nodes.
Issue #4938 - Refactored code of columns node.
Issue #3538 - Fix issue where the Reset button does not get enabled till all the mandatory fields are provided in the
dialog.
Issue #4220 - Fix scrolling issue in ‘Users’ dialog.
Issue #4516 - Remove the sorting of table headers with no labels.
Issue #4659 - Updated documentation for default privileges to clarify more on the grantor.
Issue #4674 - Fix query tool launch error if user name contains HTML characters. It’s a regression.
Issue #4724 - Fix network disconnect issue while establishing the connection via SSH Tunnel and it impossible to
expand the Servers node.
Issue #4761 - Fix an issue where the wrong type is displayed when changing the datatype from timestamp with time
zone to timestamp without time zone.
Issue #4792 - Ensure that the superuser should be able to create database, as the superuser overrides all the access
restrictions.
Issue #4818 - Fix server connection drops out issue in query tool.
Issue #4836 - Updated the json file name from ‘servers.json’ to ‘pgadmin4/servers.json’ in the container deployment
section of the documentation.
Issue #4878 - Ensure that the superuser should be able to create role, as the superuser overrides all the access
restrictions.
Issue #4893 - Fix reverse engineering SQL issue for partitions when specifying digits as comments.
Issue #4923 - Enhance the logic to change the label from ‘Delete/Drop’ to ‘Remove’ for the server and server group
node.
Issue #4925 - Shown some text on process watcher till the initial logs are loaded.
Issue #4926 - Fix VPN network disconnect issue where pgAdmin4 hangs on expanding the Servers node.
Issue #4930 - Fix main window tab navigation accessibility issue.
Issue #4933 - Ensure that the Servers collection node should expand independently of server connections.
Issue #4934 - Fix the help button link on the User Management dialog.
Issue #4935 - Fix accessibility issues.
Issue #4947 - Fix XSS issue in explain and explain analyze for table and type which contain HTML.
Issue #4952 - Fix an issue of retrieving properties for Compound Triggers. It’s a regression of #4006.
Issue #4953 - Fix an issue where pgAdmin4 unable to retrieve table node if the trigger is already disabled and the
user clicks on Enable All.
Issue #4958 - Fix reverse engineering SQL issue for triggers when passed a single argument to trigger function.
Issue #4964 - Fix an issue where length and precision are not removed from table/column dialog.
Issue #4965 - Fix an issue where the Interval data type is not displayed in the properties dialog of table/column.
Issue #4966 - Fix ‘Could not find the object on the server.’ error while refreshing the check constraint.
Issue #4975 - Fix issue where the user can not switch the UI language. It’s a regression of #4348.
Issue #4976 - Fix reverse engineering SQL issue where when clause is not visible for PG/EPAS 12.
Issue #4978 - Fix pgAdmin4 failed to start issue after upgrading to version 4.15.
Issue #4982 - Added statistics and storage information in reverse engineering SQL of table/column.
Issue #4985 - Fix an issue where the inherited table name with quotes did not escape correctly.
Issue #4991 - Fix an issue where context menu is open along with submenu and the focus is not on context menu or
submenu.
Issue #1974 - Added encrypted password in reverse engineered SQL for roles.
Issue #3741 - Added Dark(Beta) UI Theme option.
Issue #4006 - Support Enable Always and Enable Replica on triggers.
Issue #4351 - Add an option to request confirmation before cancelling/resetting changes on a Properties dialog.
Issue #4348 - Added support for custom theme creation and selection.
11.11.2 Housekeeping
Issue #3130 - Ensure create new object dialog should be opened when alt+shift+n key is pressed on the collection
node.
Issue #3279 - Fixed issue where Drop and Disconnect connection menu points are too close to each other.
Issue #3789 - Ensure context menus never get hidden below the menu bar.
Issue #3859 - Rename the context menu from ‘Drop Server’ to ‘Remove Server’.
Issue #3913 - Ensure the correct “running at” agent is shown when a pgAgent job is executing.
Issue #3915 - Fix an issue in the Query Tool where shortcut keys could be ignored following a query error.
Issue #3999 - Fix the toggle case shortcut key combination.
Issue #4173 - Fix an issue where a black arrow-kind image is displaying at the background of browser tree images.
Issue #4191 - Ensure comments are shown in reverse engineered SQL for table partitions.
Issue #4242 - Handle NULL values appropriately when sorting backgrid tables.
Issue #4341 - Give appropriate error messages when the user tries to use an blank master password.
Issue #4451 - Remove arbitrary (and incorrect) requirement that composite types must have at least two members.
Issue #4459 - Don’t quote bigints when copying them from the Query Tool results grid.
Issue #4482 - Ensure compression level is passed to pg_dump when backing up in directory format.
Issue #4483 - Ensure the number of jobs can be specified when backing up in directory format.
Issue #4564 - Ensure Javascript errors during Query Tool execution are reported as such and not as Ajax errors.
Issue #4610 - Suppress Enter key presses in Alertify dialogues when the come from Select2 controls to allow item
selection with Enter.
Issue #4647 - Ensure that units are respected when sorting by file size in the File dialog.
Issue #4730 - Ensure all messages are retained in the Query Tool from long running queries.
Issue #4734 - Updated documentation for the delete row button that only strikeout the row instead of deleting it.
Issue #4779 - Updated documentation for the query tool toolbar buttons.
Issue #4835 - Fixed an issue where psql of v12 throwing “symbol not found” error while running Maintenance and
Import/Export.
Issue #4845 - Fixed potential error in the properties dialog for the Code tab.
Issue #4850 - Fixed an issue where Datetimepicker control opens when clicking on the label.
Issue #4895 - Fixed potential issue in reset function for nested objects.
Issue #4896 - Fixed an issue where escape key not working to close the open/save file dialog.
Issue #4906 - Fixed an issue where keyboard shortcut for context menu is not working when using Firefox on
CentOS7.
Issue #4924 - Fixed docker container exit issue occurs due to change in Gunicorn’s latest version.
Issue #3009 - Added Copy with headers functionality when copy data from Query Tool/View Data.
Issue #4778 - Implemented the Query Plan Analyser.
Issue #4823 - Include PostgreSQL 12 binaries in the container.
11.12.2 Housekeeping
Issue #4472 - Add Reverse Engineered and Modified SQL tests for Synonyms.
Issue #4628 - Add Reverse Engineered and Modified SQL tests for Unique Constraints.
Issue #4701 - Optimize Webpack to improve overall performance.
Issue #3386 - Ensure backup a partition table should not backup the whole database.
Issue #4199 - Ensure that ‘ENTER’ key in the data filter should not run the query.
Issue #4590 - Fix issue where backup fails for schema name that needs quoting.
Issue #4728 - Highlighted the color of closing or opening parenthesis when user select them in CodeMirror.
Issue #4751 - Fix issue where export job fails when deselecting all the columns.
Issue #4753 - Fix an error where ‘false’ string is displayed when we add a new parameter in the Parameters tab, also
clear the old value when the user changes the parameter name.
Issue #4755 - Ensure that pgAdmin should work behind reverse proxy if the inbuilt server is used as it is.
Issue #4756 - Fix issue where pgAdmin does not load completely if loaded in an iframe.
Issue #4760 - Ensure the search path should not be quoted for Database.
Issue #4768 - Ensure pgAdmin should work behind reverse proxy on a non standard port.
Issue #4769 - Fix query tool open issue on Internet Explorer.
Issue #4777 - Fix issue where query history is not visible in the query history tab.
Issue #4780 - Ensure the search path should not be quoted for Function, Procedure and Trigger Function.
Issue #4791 - Fix issue where VALID foreign keys show as NOT VALID in the SQL tab for tables.
Issue #4817 - Ensure the MAC OSX app should be notarized for Catalina.
Issue #2828 - Added Gather Merge, Named Tuple Store Scan and Table Function Scan icon for explain module.
Issue #4553 - Don’t wait for the database connection before rendering the Query Tool UI, for improved UX.
Issue #4651 - Allow configuration options to be set from the environment in the container distribution.
Issue #4667 - Ensure editable and read-only columns in Query Tool should be identified by icons and tooltips in the
column header.
Issue #4691 - Add an Italian translation.
Issue #4752 - Refactor Dockerfile to avoid needing to run supporting scripts (i.e. ‘docker build .’ will work) and
minimise layers.
11.13.2 Housekeeping
Issue #4631 - Add editor options for plain text mode and to disable block folding to workaround rendering speed
issues in CodeMirror with very large scripts.
Issue #4642 - Ensure port and username should not be mandatory when a service is provided.
Issue #4643 - Fix Truncate option deselect issue for compound triggers.
Issue #4644 - Fix length and precision enable/disable issue when changing the data type for Domain node.
Issue #4650 - Fix SQL tab issue for Views. It’s a regression of compound triggers.
Issue #4657 - Fix PGADMIN_SERVER_JSON_FILE environment variable support in the container.
Issue #4663 - Fix exception in query history for python 2.7.
Issue #4674 - Fix query tool launch error if user name contain html characters.
Issue #4681 - Increase cache control max age for static files to improve performance over longer run.
Issue #4698 - Fix SQL issue of length and precision when changing the data type of Column.
Issue #4702 - Fix modified SQL for Index when reset the value of Fill factor and Clustered?.
Issue #4703 - Fix reversed engineered SQL for btree Index when provided sort order and NULLs.
Issue #4726 - Ensure sequence with negative value should be created.
Issue #4727 - Fix issue where EXEC script doesn’t write the complete script for Procedures.
Issue #4736 - Fix query tool and view data issue with the Italian language.
Issue #4742 - Ensure Primary Key should be created with Index.
Issue #4750 - Fix query history exception for Python 3.6.
11.14.2 Housekeeping
Issue #3605 - Fix issue where Deleting N number of rows makes first N number of rows disable.
Issue #4179 - Fix generation of reverse engineered SQL for tables with Greenplum 5.x.
Issue #4229 - Update wcDocker to allow the browser’s context menu to be used except in tab strips and panel headers.
Issue #4401 - Ensure type names are properly encoded in the results grid.
Issue #4414 - Fix generation of reverse engineered SQL for partition table, partitions were shown as a child of
indexes.
Issue #4489 - Update wcDocker to prevent window state loading creating blank dialogues.
Issue #4490 - Fix accessibility issue for checkbox in IE11.
Issue #4492 - Ensure the Query Tool doesn’t throw an error when viewing the contents of a table with no columns.
Issue #4496 - Ensure columns can be created when they are IDENTITY fields with the CYCLE option enabled.
Issue #4497 - Ensure purely numeric comments can be saved on new columns.
Issue #4508 - Fix accessibility issue for Datetime cell in backgrid.
Issue #4520 - Ensure the query tool will work with older versions of psycopg2 than we officially support, albeit
without updatable resultsets.
Issue #4525 - Ensure command tags are shown in the messages tab of the Query Tool.
Issue #4536 - Fix load on demand in View/Edit data mode.
Issue #4552 - Fix some errors thrown on the JS console when dragging text in the Query Tool.
Issue #4559 - Ensure triggers should be updated properly for EPAS server.
Issue #4565 - Fix the reverse engineered SQL for trigger functions with the WINDOW option selected.
Issue #4578 - Ensure enable trigger menu should be visible when trigger is disabled.
Issue #4581 - Ensure the comment on a Primary Key constraint can be edited under the Table node.
Issue #4582 - Fix console error when changing kind(SQL/BATCH) for pgAgent job step.
Issue #4585 - Fix double click issue to expand the contents of a cell if the resultset was not editable.
Issue #4586 - Fix generation of reverse engineered SQL for Rules.
Issue #4635 - Ensure compound triggers for event should be updated properly.
Issue #4638 - Ensure compound triggers should be displayed under Views.
Issue #4641 - Ensure Truncate option should be available for Compound Triggers.
Issue #1760 - Add support for editing of resultsets in the Query Tool, if the data can be identified as updatable.
Issue #4318 - Set the mouse cursor appropriately based on the layout lock state.
Issue #4335 - Add EXPLAIN options for SETTINGS and SUMMARY.
11.15.2 Housekeeping
Issue #4415 - Add Reverse Engineered SQL tests for Roles and Resource Groups.
Issue #4441 - Add Reverse Engineered SQL tests for FDWs.
Issue #4452 - Add Reverse Engineered SQL tests for Languages.
Issue #4453 - Add Reverse Engineered SQL tests for Extensions.
Issue #4454 - Add Reverse Engineered SQL tests for FTS Configurations.
Issue #4456 - Add Reverse Engineered SQL tests for Packages.
Issue #4460 - Add Reverse Engineered SQL tests for FTS Dictionaries.
Issue #4463 - Add Reverse Engineered SQL tests for Domains.
Issue #4464 - Add Reverse Engineered SQL tests for Collations.
Issue #4468 - Add Reverse Engineered SQL tests for Types.
Issue #4469 - Add Reverse Engineered SQL tests for Sequences.
Issue #4471 - Add Reverse Engineered SQL tests for FTS Parsers.
Issue #4475 - Add Reverse Engineered SQL tests for Constraints.
Issue #4139 - Allow some objects to be dragged/dropped into the Query Tool to insert their signature into the query
text.
Issue #4400 - Allow the path to /pgadmin4/servers.json to be overridden in the container distribution.
Issue #4403 - Ensure the browser close confirmation is only shown when closing a Query Tool which is running in a
separate browser tab.
Issue #4404 - Prevent an error that may occur when editing data with an integer primary key.
Issue #4407 - Fix a quoting issue that caused a blank UI to be displayed when running in French.
Issue #4421 - Ensure the version comparision should be correct for windows installer.
Issue #3174 - Visually distinguish simple tables from tables that are inherited and from which other tables are
inherited.
11.17.2 Housekeeping
Issue #4202 - Add a framework for testing reversed engineered SQL and CRUD API endpoints.
Issue #3994 - Fix issue where the dependencies tab for inherited tables/foreign keys shows partial text.
Issue #4036 - Allow editing of data where a primary key column includes a % sign in the value.
Issue #4171 - Fix issue where reverse engineered SQL was failing for foreign tables, if it had “=” in the options.
Issue #4195 - Fix keyboard navigation in “inner” tabsets such as the Query Tool and Debugger.
Issue #4228 - Ensure the correct label is used in panel headers when viewing filtered rows.
Issue #4253 - Fix issue where new column should be created with Default value.
Issue #4283 - Initial support for PostgreSQL 12.
Issue #4288 - Initial support for PostgreSQL 12.
Issue #2653 - Allow the UI layout to be fully locked or to prevent docking changes.
Issue #4169 - Omit the geometry viewer in the Query Tool from layout saving.
Issue #4307 - Improve the performance of explain plan by embedding the images only when downloading it.
Issue #4308 - Fix the issue of accessing the SQL for Views and Materialized Views. Regression of pluralisation of
folder names.
Issue #3377 - In server mode, update all the saved server credentials when user password is changed.
Issue #3885 - Fix the responsive layout of the main menu bar.
Issue #4162 - Fix syntax error when adding more than one column to the existing table.
Issue #4164 - Fix file browser path issue which occurs when client is on Windows and server is on Mac/Linux.
Issue #4184 - Added Master Password to increase the security of saved passwords.
Issue #4194 - Fix accessibility issue for menu navigation.
Issue #4208 - Update the UI logo.
Issue #4217 - Fixed CSRF security vulnerability issue, per Alvin Lindstam
Issue #4218 - Properly assign dropdownParent in Select2 controls.
Issue #4219 - Ensure popper.js is installed when needed.
Issue #4227 - Fixed Tab key navigation for Maintenance dialog.
Issue #4244 - Fix Tab key issue for Toggle switch controls and button on the dialog footer in Safari browser.
Issue #4245 - Ensure that element should get highlighted when they get focus on using Tab key.
Issue #4246 - Fixed console error when subnode control is used in panels.
Issue #4261 - Stop using application/x-javascript as a mime type and use the RFC-compliant application/javascript
instead.
Issue #4262 - Fixed error on displaying table properties of a table partitioned by list having a default partition.
Issue #4263 - Fix handling of JSON in the Query Tool with NULL elements.
Issue #4269 - Fix navigation of switch cells in grids.
Issue #4275 - Clarify wording for the NO INHERIT option on constraints, per Michel Feinstein.
Issue #4276 - Relax the permission check on the directory containing the config database, as it may fail in some
environments such as OpenShift.
Issue #4278 - Prevent Backgrid Password cells from losing focus if the browser opens an autocomplete list.
Issue #4284 - Fix syntax error when creating a table with a serial column.
11.20.1 Features
Issue #4165 - Depend on psycopg2-binary in the Python wheel, rather than psycopg2.
Issue #2392 - Ensure that on clicking Delete button should not delete rows immediately from the database server, it
should be deleted when Save button will be clicked.
Issue #3327 - Ensure that newly added row in backgrid should be visible.
Issue #3582 - Ensure that JSON strings as comments should be added properly for all the objects.
Issue #3605 - Fix an issue where Deleting N number of rows makes first N number of rows disable.
Issue #3938 - Added support for Default Partition.
Issue #4087 - Fix an issue where ‘GRANT UPDATE’ sql should be displayed for default sequence privileges.
Issue #4101 - Ensure that confirmation dialog should be popped up before reload of query tool or debugger if it is
opened in a new browser tab.
Issue #4104 - Ensure that record should be add/edited for root partition table with primary keys.
Issue #4121 - Fixed alignment issue of columns in definition section of Index node.
Issue #4134 - Fixed ‘Location cannot be empty’ error when open Tablespace properties.
Issue #4138 - Fix an issue where the dropdown becomes misaligned/displaced.
Issue #4154 - Ensure the treeview shows all sequences except those used to implement IDENTITY columns (which
can be edited as part of the column). Show all if Show System Objects is enabled.
Issue #4160 - Fixed ‘Increment value cannot be empty’ error for existing tables.
Issue #4161 - Ensure that parameters of procedures for EPAS server 10 and below should be set/reset properly.
Issue #4163 - Prevent duplicate columns being included in reverse engineered SQL for tables.
Issue #4182 - Ensure sanity of the permissions on the storage and session directories and the config database.
Warning: This release includes a bug fix (Issue #3887) which will rename the per-user storage directories for
existing users when running in server mode. Previously, saved SQL queries were stored under the STORAGE_DIR
in a sub-directory named after the username part of the user’s email address. From this version onwards, the full
email address is used, with the @ replaced with an underscore. For example, in v.4.3 with STORAGE_DIR set to
/var/lib/pgadmin4 user files may be stored in:
/var/lib/pgadmin4/storage/username/
With the fix, that directory will be renamed (or created for new users) as:
/var/lib/pgadmin4/storage/username_example.com/
11.22.1 Features
Issue #2001 - Add support for reverse proxied setups with Gunicorn, and document Gunicorn, uWSGI & NGINX
configurations.
Issue #4017 - Make the Query Tool history persistent across sessions.
Issue #4018 - Remove the large and unnecessary dependency on React and 87 other related libraries.
Issue #4030 - Add support for IDENTITY columns.
Issue #4075 - Add an ePub doc build target.
Issue #1269 - Fix naming inconsistency for the column and FTS parser modules.
Issue #2627 - Include inherited column comments and defaults in reverse engineered table SQL.
Issue #3104 - Improve a couple of German translations.
Issue #3887 - Use the user’s full email address (not just the username part) as the basis for the storage directory name.
Issue #3968 - Update wcDocker to fix the issue where the Scratch Pad grows in size if the results panel is resized.
Issue #3995 - Avoid ‘bogus varno’ message from Postgres when viewing the SQL for a table with triggers.
Issue #4019 - Update all Python and JavaScript dependencies.
Issue #4037 - Include comment SQL for inherited columns in reverse engineered table SQL.
Issue #4050 - Make the WHEN field a CodeMirror control on the Event Trigger dialogue.
Issue #4052 - Fix the online help button on the resource group dialogue.
Issue #4053 - Enable the online help button on the index dialogue.
Issue #4054 - Handle resultsets with zero columns correctly in the Query Tool.
Issue #4058 - Include inherited columns in SELECT scripts.
Issue #4060 - Fix the latexpdf doc build.
Issue #4062 - Fix handling of numeric arrays in View/Edit Data.
Issue #4063 - Enlarge the grab handles for resizing dialogs etc.
Issue #4069 - Append the file suffix to filenames when needed in the File Create dialogue.
Issue #4071 - Ensure that Firefox prompts for a filename/location when downloading query results as a CSV file.
Issue #4073 - Change the CodeMirror active line background colour to $color-danger-lighter so it doesn’t conflict
with the selection colour.
Issue #4081 - Fix the RE-SQL syntax for roles with a VALID UNTIL clause.
Issue #4082 - Prevent an empty error message being shown when “downloading” a CREATE script using the CSV
download.
Issue #4084 - Overhaul the layout saving code so it includes the Query Tool and Debugger, and stores the layout
when change events are detected rather than (unreliably) on exit.
Issue #4085 - Display errors during CSV download from the Query Tool in the UI rather than putting them in the
CSV file.
Issue #4090 - Improve the German translation for Backup Server.
Issue #4096 - Ensure the toolbar buttons are properly reset following a CSV download in the Query Tool.
Issue #4099 - Fix SQL help for EPAS 10+, and refactor the URL generation code into a testable function.
Issue #4100 - Ensure sequences can be created with increment, start, minimum and maximum options set.
Issue #4105 - Fix an issue where JSON data would not be rendered in the Query Tool.
Issue #4109 - Ensure View/Materialized View node should be visible after updating any property.
Issue #4110 - Fix custom autovacuum configuration for Materialized Views.
11.23.1 Features
Issue #1825 - Install a script to start pgAdmin (pgadmin4) from the command line when installed from the Python
wheel.
Issue #2233 - Add a “scratch pad” to the Query Tool to hold text snippets whilst editing.
Issue #2418 - Add Commit and Rollback buttons to the Query Tool.
Issue #3439 - Allow X-FRAME-OPTIONS to be set for security. Default to SAMEORIGIN.
Issue #3559 - Automatically expand child nodes as well as the selected node on the treeview if there is only one.
Issue #3886 - Include multiple versions of the PG utilties in containers.
Issue #3991 - Update Alpine Linux version in the docker container.
Issue #4034 - Support double-click on Query Tool result grid column resize handles to auto-size to the content.
Bug #3096 - Ensure size stats are prettified on the statistics tab when the UI language is not English.
Bug #3352 - Handle display of roles with expiration set to infinity correctly.
Bug #3418 - Allow editing of values in columns with the oid datatype which are not an actual row OID.
Bug #3544 - Make the Query Tool tab titles more concise and useful.
Bug #3587 - Fix support for bigint’s in JSONB data.
Bug #3583 - Update CodeMirror to 5.43.0 to resolve issues with auto-indent.
Bug #3600 - Ensure JSON data isn’t modified in-flight by psycopg2 when using View/Edit data.
Bug #3673 - Modify the Download as CSV option to use the same connection as the Query Tool its running in so
temporary tables etc. can be used.
Bug #3873 - Fix context sub-menu alignment on Safari.
Bug #3890 - Update documentation screenshots as per new design.
Bug #3906 - Fix alignment of Close and Maximize button of Grant Wizard.
Bug #3911 - Add full support and testsfor all PG server side encodings.
Bug #3912 - Fix editing of table data with a JSON primary key.
Bug #3933 - Ignore exceptions in the logger.
Bug #3942 - Close connections gracefully when the user logs out of pgAdmin.
Bug #3946 - Fix alignment of checkbox to drop multiple schedules of pgAgent job.
Bug #3958 - Don’t exclude SELECT statements from transaction management in the Query Tool in case they call
data-modifying functions.
Bug #3959 - Optimise display of Dependencies and Dependents, and use on-demand loading of rows in batches of
100.
Bug #3963 - Fix alignment of import/export toggle switch.
Bug #3970 - Prevent an error when closing the Sort/Filter dialogue with an empty filter string.
Bug #3974 - Fix alignment of Connection type toggle switch of pgagent.
Bug #3981 - Fix the query to set bytea_output so that read-only standbys don’t consider it a write query.
Bug #3982 - Add full support and testsfor all PG server side encodings.
Bug #3985 - Don’t embed docs and external sites in iframes, to allow the external sites to set X-FRAME-OPTIONS
= DENY for security.
Bug #3992 - Add full support and testsfor all PG server side encodings.
Bug #3998 - Custom-encode forward slashes in URL parameters as Apache HTTPD doesn’t allow them in some
cases.
Bug #4000 - Update CodeMirror to 5.43.0 to resolve issues with tab indent with use spaces enabled.
Bug #4013 - Ensure long queries don’t cause errors when downloading CSV in the Query Tool.
Bug #4021 - Disable the editor and execute functions whilst queries are executing.
Bug #4022 - Fix an issue where importing servers fails if a group already exists for a different user.
Issue #3051 - Replace Bootstrap switch with Bootstrap4 toggle to improve the performance.
Issue #3272 - Replace the PyCrypto module with the cryptography module.
Issue #3453 - Fixed SQL for foreign table options.
Issue #3475 - Fixed execution time to show Hours part for long running queries in Query Tool.
Issue #3608 - Messages tab of Query Tool should be clear on subsequent execution of table/view using View/Edit
Data.
Issue #3609 - Clear drop-down menu should be disabled for View/Edit Data.
Issue #3664 - Fixed Statistics panel hang issue for 1000+ tables.
Issue #3693 - Proper error should be thrown when server group is created with existing name.
Issue #3695 - Ensure long string should be wrap in alertify dialogs.
Issue #3697 - Ensure that output of the query should be displayed even if Data Output window is detached from the
Query Tool.
Issue #3740 - Inline edbspl trigger functions should not be visible in Grant Wizard.
Issue #3774 - Proper SQL should be generated when create function with return type as custom type argument.
Issue #3800 - Ensure that database restriction of server dialog should work with special characters.
Issue #3811 - Ensure that Backup/Restore button should work on single click.
Issue #3837 - Fixed SQL for when clause while creating Trigger.
Issue #3838 - Proper SQL should be generated when creating/changing column with custom type argument.
Issue #3840 - Ensure that file format combo box value should be retained when hidden files checkbox is toggled.
Issue #3846 - Proper SQL should be generated when create procedure with custom type arguments.
Issue #3849 - Ensure that browser should warn before close or refresh.
Issue #3850 - Fixed EXEC script for procedures.
Issue #3853 - Proper SQL should be generated when create domain of type interval with precision.
Issue #3858 - Drop-down should be closed when click on any other toolbar button.
Issue #3862 - Fixed keyboard navigation for dialog tabs.
Issue #3865 - Increase frames splitter mouse hover area to make it easier to resize.
Issue #3871 - Fixed alignment of tree arrow icons for Internet Explorer.
Issue #3872 - Ensure object names in external process dialogues are properly escaped.
Issue #3891 - Correct order of Save and Cancel button for json/jsonb editing.
Issue #3897 - Data should be updated properly for FTS Configurations, FTS Dictionaries, FTS Parsers and FTS
Templates.
Issue #3899 - Fixed unable to drop multiple Rules and Foreign Tables from properties tab.
Issue #3903 - Fixed Query Tool Initialization Error.
Issue #3908 - Fixed keyboard navigation for Select2 and Privilege cell in Backgrid.
Issue #3916 - Correct schema should be displayed in Materialized View dialog.
Issue #3927 - Fixed debugger issue for procedure inside package for EPAS servers.
Issue #3929 - Fix alignment of help messages in properties panels.
Issue #3932 - Fix alignment of submenu for Internet Explorer.
Issue #3935 - Ensure that grant wizard should list down functions for EPAS server running with no-redwood-compat
mode.
Issue #3941 - Dashboard graph optimization.
Issue #3954 - Remove Python 2.6 code that’s now obsolete.
Issue #3955 - Expose the bind address in the Docker container via PGADMIN_BIND_ADDRESS.
Issue #3961 - Exclude HTTPExceptions from the all_exception_handler as they should be returned as-is.
Issue #3505 - Fix SQL generated for tables with inherited columns.
Issue #3575 - Ensure the context menu works after a server is renamed.
Issue #3836 - Fix ordering of VACUUM options which changed in PG11.
Issue #3842 - Don’t show system catalogs in the schemas property list unless show system objects is enabled.
Issue #3861 - Fix help for the backup/restore dialogues.
Issue #3866 - Ensure that last row of table data should be visible and user will be able to add new row.
Issue #3877 - Make the browser more robust in the face of multibyte characters in SQL_ASCII databases.
11.26.1 Features
Issue #3083 - Increase the size of the resize handle of the edit grid text pop-out.
Issue #3354 - Fix handling of array types as inputs to the debugger.
Issue #3433 - Fix an issue that could cause the Query Tool to fail to render.
Issue #3549 - Display event trigger functions correctly on EPAS.
Issue #3559 - Further improvements to treeview restoration.
Issue #3599 - Run Postfix in the container build so passwords can be reset etc.
Issue #3619 - Add titles to the code areas of the Query Tool and Debugger to ensure that panels can be re-docked
within them.
Issue #3679 - Fix a webpack issue that could cause the Query Tool to fail to render.
Issue #3702 - Ensure we display the relation name (and not the OID) in the locks table wherever possible.
Issue #3711 - Fix an encoding issue in the Query Tool.
Issue #3726 - Include the WHERE clause on EXCLUDE constraints in RE-SQL.
Issue #3753 - Fix an issue when user define Cast from smallint->text is created.
Issue #3757 - Hide Radio buttons that should not be shown on the maintenance dialogue.
Issue #3780 - Ensure that null values handled properly in CSV download.
Issue #3796 - Tweak the wording on the Grant Wizard.
Issue #3797 - Prevent attempts to bulk-drop schema objects.
Issue #3798 - Ensure the browser toolbar buttons work in languages other than English.
Issue #3805 - Allow horizontal sizing of the edit grid text pop-out.
Issue #3809 - Ensure auto complete should works when first identifier in the FROM clause needs quoting.
Issue #3810 - Ensure auto complete should works for columns from a schema-qualified table.
Issue #3821 - Ensure identifiers are properly displayed in the plan viewer.
Issue #3830 - Make the setup process more robust against aborted executions.
Issue #3856 - Fixed an issue while creating export job.
11.27.1 Features
Issue #1513 - Add support for dropping multiple objects at once from the collection Properties panel.
Issue #3772 - Add the ability to import and export server definitions from a config database.
Issue #3016 - Ensure previous notices are not removed from the Messages tab in the Query Tool if an error occurs
during query execution.
Issue #3029 - Allow the selection order to be preserved in the Select2 control to fix column ordering in data
Import/Export.
Issue #3629 - Allow use of 0 (integer) and empty strings as parameters in the debugger.
Issue #3723 - Properly report errors when debugging cannot be started.
Issue #3734 - Prevent the debugger controls being pressed again before previous processing is complete.
Issue #3736 - Fix toggle breakpoints buttons in the debugger.
Issue #3742 - Fix changes to the NOT NULL and default value options in the Table Dialogue.
Issue #3746 - Fix dropping of multiple functions/procedures at once.
11.28.1 Features
Issue #1253 - Save the treeview state periodically, and restore it automatically when reconnecting.
Issue #3562 - Migrate from Bootstrap 3 to Bootstrap 4.
Issue #3232 - Ensure that Utilities(Backup/Restore/Maintenence/Import-Export) should not be started if binary path
is wrong and also added ‘Stop Process’ button to cancel the process.
Issue #3638 - Fix syntax error when creating new pgAgent schedules with a start date/time and exception.
Issue #3674 - Cleanup session files periodically.
Issue #3660 - Rename the ‘SQL Editor’ section of the Preferences to ‘Query Tool’ as it applies to the whole tool, not
just the editor.
Issue #3676 - Fix CREATE Script functionality for EDB-Wrapped functions.
Issue #3700 - Fix connection garbage collector.
Issue #3703 - Purge connections from the cache on logout.
Issue #3722 - Ensure that utility existence check should work for schema and other child objects while taking
Backup/Restore.
Issue #3730 - Fixed fatal error while launching the pgAdmin4 3.5. Update the version of the Flask to 0.12.4 for
release.
11.29.1 Features
Issue #2927 - Move all CSS into SCSS files for consistency and ease of colour maintenance etc.
Issue #3514 - Add optional data point markers and mouse-over tooltips to display values on graphs.
Issue #3564 - Add shortcuts for View Data and the Query tool to the Browser header bar.
Issue #3464 - Ensure the runtime can startup properly if there are wide characters in the logfile path on Windows.
Issue #3551 - Fix handling of backslashes in the edit grid.
Issue #3576 - Ensure queries are no longer executed when dashboards are closed.
Issue #3596 - Fix support for the CLOB datatype in EPAS.
Issue #3607 - Fix logic around validation and highlighting of Sort/Filter in the Query Tool.
Issue #3630 - Ensure auto-complete works for objects in schemas other than public and pg_catalog.
Issue #3657 - Ensure changes to Query Tool settings from the Preferences dialogue are applied before executing
queries.
Issue #3658 - Swap the Schema and Schemas icons and Catalog and Catalogs icons that had been used the wrong
way around.
11.30.1 Features
Issue #1407 - Add a geometry viewer that can render PostGIS data on a blank canvas or various map sources.
Issue #3503 - Added new backup/restore options for PostgreSQL 11. Added dump options for ‘pg_dumpall’.
Issue #3553 - Add a Spanish translation.
11.31.1 Features
Issue #2136 - Added version number for URL’s to ensure that files are only cached on a per-version basis.
Issue #2214 - Add support for SCRAM password changes (requires psycopg2 >= 2.8).
Issue #3074 - Add support for reset saved password.
Issue #3397 - Add support for Trigger and JIT stats in the graphical query plan viewer.
Issue #3412 - Add support for primary key, foreign key, unique key, indexes and triggers on partitioned tables for
PG/EPAS 11.
Issue #3506 - Allow the user to specify a fixed port number in the runtime to aid cookie whitelisting etc.
Issue #3510 - Add a menu option to the runtime to copy the appserver URL to the clipboard.
11.32.1 Features
Issue #1220 - Backup and Restore should not be started if database name contains “=” symbol
Issue #1221 - Maintenance should not be started if database name contains “=” symbol
Issue #3179 - Fix an error generating SQL for trigger functions
Issue #3238 - Standardise the error handling for parsing of JSON response messages from the server
Issue #3250 - Fix handling of SQL_ASCII data in the Query Tool
Issue #3257 - Catch errors when trying to EXPLAIN an invalid query
Issue #3277 - Ensure server cleanup on exit only happens if the server actually started up
Issue #3284 - F5 key should work to refresh Browser tree
11.33.1 Features
Issue #3031 - Runtime issue causing double and single quotes not to work
Issue #3039 - Runtime issue causing wrong row counts on count column
Issue #3042 - Runtime issue causing empty dialog box when refreshing
Issue #3043 - Runtime issue causing word sizing in macOS High Sierra
Issue #3045 - Runtime issue causing copy cells issues copying cells for key binding
Issue #3046 - Fix connection status indicator on IE/FF
Issue #3050 - Correct display of RE-SQL for partitioned tables in Greenplum
Issue #3052 - Don’t include sizes on primitive data types that shouldn’t have them when modifying columns
Issue #3054 - Ensure the user can use keyboard shortcuts after using button controls such as Cancel, Open and Save
Issue #3057 - Update the regression tests to fix issues with Python 3.5 and PG 9.2
Issue #3058 - Fix on-click handling of treeview nodes that wasn’t refreshing SQL/Dependencies/Dependents in some
circumstances
Issue #3059 - Fix table statistics for Greenplum
Issue #3060 - Fix quoting of function names in RE-SQL
Issue #3066 - Ensure column names on indexes on views are properly quoted in RE-SQL
Issue #3067 - Prevent the filter dialog CodeMirror from overflowing onto the button bar of the dialog
Issue #3072 - Add a (configurable) limit to the number of pgAgent job history rows displayed on the statistics tab
Issue #3073 - Ensure the pgAgent job start/end time grid fields synchronise with the subnode control and validate
correctly
Issue #3075 - Runtime issue causing Select, Update, and Insert script generation for a table fails to load
Issue #3077 - Remove dependency on standards_conforming_strings being enabled
Issue #3079 - Fix handling of tie/datetime array types when adding columns to a table
Issue #3080 - Fix alignment issues in keyboard shortcut options
Issue #3081 - Add missing reverse-engineered SQL header and drop statement for sequences
Issue #3090 - Ensure message severity is decoded when necessary by the driver
Issue #3094 - Ensure all messages are retrieved from the server in the Query Tool
Issue #3099 - Fix creation of tables and columns in GPDB
Issue #3105 - Ensure we can properly update rows with upper-case primary key columns
Issue #3135 - Insert rows correctly when a table has OIDs and a Primary Key in uppercase
Issue #3122 - Ensure SSL options are pushed down to external tools like pg_dump
Issue #3129 - Handle opening of non-UTF8 compatible files
Issue #3137 - Allow copying of SQL from the dashboard tables
Issue #3138 - Fix tablespace tests for Python 3.x
Issue #3150 - Fix function reserve SQL for GPDB
Issue #3157 - Fix unicode handling in the external process tools and show the complete command in the process
viewer
Issue #3171 - Runtime issue causing inability to scroll in File Selector with trackpad on OSX
Issue #3176 - Disable function statistics on Greenplum
Issue #3180 - Ensure Indexes are displayed on PG 10 tables
Issue #3190 - Skip tests where appropriate on GPDB
Issue #3196 - Ensure the file manager properly escapes file & directory names
Issue #3197 - Appropriately set the cookie path
Issue #3200 - Ensure the host parameter is correctly pickup up from the service file
Issue #3219 - Update required ChromeDriver version for current versions of Chrome
Issue #3226 - Move the field error indicators in front of the affected fields so they don’t obscure spinners or drop
downs etc.
Issue #3244 - Show more granular timing info in the Query Tool history panel
Issue #3248 - Ensure Alertify dialogues are modal to prevent them being closed by mis-click
11.34.1 Features
Issue #1383 - Allow connections to be coloured in the treeview and Query Tool
Issue #1489 - Improve user interface for selection query in Data Filter window
Issue #2368 - Improve data entry in Query Tool
Issue #2781 - Allow configuration of CSV and clipboard formatting of query results
Issue #2802 - Allow connections to be coloured in the treeview and Query Tool.
Issue #2810 - Allow files to be opened by double clicking on them within Query Tool
Issue #2845 - Make the “Save Changes” prompts in the Query Tool optional
Issue #2849 - Add support for editing data in tables with OIDs but no primary keys and updates the editor to retrieve
all row values on save, thus immediately showing default values and allowing subsequent editing without a refresh
Issue #1365 - Prevent the Windows installer accepting paths containing invalid characters
Issue #1366 - Fix /NOICONS switch in the windows installer
Issue #1436 - Fix issue with debugger which is failing for sub - procedure on PPAS 9.6
Issue #1749 - Fixes in pgAgent module including; 1) allowing start date earlier than end date when scheduling job, 2)
Datetime picker not displaying in grid and 3) validation error not displaying propertly for Datetime control
Issue #2094 - Display relevant error messages when access is denied creating a schema
Issue #2098 - Cleanup some inconsistent error dialog titles
Issue #2258 - Fix handling of DATERANGE[] type
Issue #2278 - Display long names appropriately in dialogue headers
Issue #2443 - Confirm with the user before exiting the runtime
Issue #2524 - Fix debugging of self-referencing functions
Issue #2566 - Fix the Pause/Resume Replay of WAL files for PostgreSQL 10
Issue #2624 - Ensure the switch animation is consistent on the table dialogue and avoid displaying an error incorrectly
Issue #2651 - Ensure estimated rows are included correctly in CREATE script for functions
Issue #2679 - Getting started links does not open second time if User open any URL and Click on Close button with
cross bar
Issue #2705 - User can add expirty date on Windows
Issue #2715 - Ensure we can download large files and keep the user informed about progress
Issue #2720 - Ensure password changes are successful if authenticating using a pgpass file
Issue #2726 - Ensure the auto-complete selection list can display longer names
Issue #2738 - Ensure line numbers form CodeMirror don’t appear on top of menus
Issue #2748 - Format JSON/JSONB nicely when displaying it in the grid editor pop-up
Issue #2760 - When selecting an SSL cert or key, update only the expected path in the UI, not all of them
Issue #2765 - Do not decrypt the password when the password is ‘None’. This should avoid the common but
harmless exception “ValueError: IV must be 16 bytes long while decrypting the password.”
Issue #2768 - Only allow specification of a pgpass file if libpq >= 10
Issue #2769 - Correct keyboard shortcut. Don’t un-comment code with alt+. in the Query Tool. It’s only supposed to
respond to ctrl/cmd+
Issue #2772 - Remove external links from Panel’s context menu
Issue #2778 - Ensure the datatype cache is updated when a domain is added
Issue #2779 - Ensure column collation isn’t lost when changing field size
Issue #2780 - Ensure auto-indent honours the spaces/tabs config setting
Issue #2782 - Re-hash the way that we handle rendering of special types such as arrays
Issue #2787 - Quote the owner name when creating types
Issue #2806 - Attempt to decode database errors based on lc_messages
Issue #2811 - Display process output as it happens
Issue #2820 - Logs available when executing backup and restore
Issue #2821 - Attempt to decode database errors based on lc_messages
Issue #2822 - Re-hash the way that we handle rendering of special types such as arrays.
Issue #2824 - Fix a number of graphical explain rendering issues
Issue #2836 - Fix counted rows display in table properties
Issue #2842 - Fix a number of graphical explain rendering issues
Issue #2846 - Add an option to manually count rows in tables to render the properties
Issue #2854 - Fix utility output capture encoding
Issue #2859 - Allow form validation messages to be close in case the eclipse anything on the form
Issue #2866 - Ensure we don’t show the full path on the server when using virtual filesystem roots in server mode for
SSL certs
Issue #2875 - Ensure the scroll location is retains in the Query Tool data grid if the user changes tab and then returns
Issue #2877 - Remove the artificial limit of 4000 characters from text areas
Issue #2880 - Honour whitespace properly in the data grid
Issue #2881 - Fix support for time without timezone
Issue #2886 - Resolve issue where Insert failed when tried with default primary key value
Issue #2891 - Allow changing of the users password without leaving the app
Issue #2892 - Refuse password changes (and tell the user) if the notification email cannot be sent
Issue #2908 - Fix bundle creation on Windows which was failing due to rn line endings in code mirror
Issue #2918 - Add missing init.py to backports.csv when building the MSVC windows build
Issue #2920 - Push HTTPD logs to container stdout/stderr as appropriate
Issue #2921 - Fixes in pgAgent module including; 1) allowing start date earlier than end date when scheduling job, 2)
Datetime picker not displaying in grid and 3) validation error not displaying propertly for Datetime control
Issue #2922 - Don’t login the user with every request in desktop mode. Just do it once
Issue #2923 - Prevent the user pressing the select button in the file manager when it is supposed to be disabled
Issue #2924 - Cleanup the layout of the filter data dialogue
Issue #2928 - Prevent multiple connections to new slow-to-respond servers being initiated in error
Issue #2934 - Fix a reference before assignment error in the file dialogue
Issue #2937 - Prevent attempts to select directories as files in the file dialogue
Issue #2945 - Ensure invalid options can’t be selected on triggers on views
Issue #2949 - Display complete SQL for FTS dictionaries
Issue #2952 - Don’t try to render security URLs in desktop mode
Issue #2954 - Allow selection of validation error text
Issue #2974 - Clear the messages tab when running EXPLAIN/EXPLAIN ANALYZE
11.35.1 Features
Issue #1918 - Add a field to the Server Dialogue allowing users to specify a subset of databases they’d like to see in
the treeview
Issue #2135 - Significantly speed up loading of the application
Issue #2556 - Allow for slow vs. fast connection failures
Issue #2579 - Default the file browser view to list, and make it configurable
Issue #2597 - Allow queries to be cancelled from the dashboard and display additional info in the subnode control
Issue #2649 - Support use of SSL certificates for authentication
Issue #2650 - Support use of pgpass files
Issue #2662 - Ship with pre-configured paths that can work in both Server and Desktop modes out of the box
Issue #2689 - Update icons with new designs and remove from menus to de-clutter the UI
Issue #1165 - Prevent continual polling for graph data on the dashboard if the server is disconnected
Issue #1697 - Update CodeMirror version
Issue #2043 - Properly handle trigger functions with parameters
Issue #2074 - Make $ quoting consistent
Issue #2080 - Fix issue where Browser hangs/crashes when loading data (using sql editor) from table which contains
large blob data
Issue #2153 - Fix handline of large file uploads and properly show any errors that may occur
Issue #2168 - Update CodeMirror version
Issue #2170 - Support SSL in the regression tests
Issue #2324 - Fix PostGIS Datatypes in SQL tab, Create / Update dialogues for Table, Column, Foreign Table and
Type node
Issue #2447 - Update CodeMirror version
Issue #2452 - Install pgadmin4-v1 1.5 on Centos7
Issue #2501 - Fix collation tests on Windows, replace use of default ‘POSIX’ collation with ‘C’ collation for testing
Issue #2541 - Fix issues using special keys on MacOS
Issue #2544 - Correct malformed query generated when using custom type
Issue #2551 - Show tablespace on partitions
Issue #2555 - Fix issue in Query Tool where messages were not displaying from functions/procedures properly
Issue #2557 - Tidy up tab styling
Issue #2558 - Prevent the tab bar being hidden when detached tabs are being closed
Issue #2559 - Stop tool buttons from changing their styling unexpectedly
Issue #2560 - Fix View ‘CREATE Script’ Problem
Issue #2562 - Update CodeMirror version
Issue #2742 - Ensure using an alternate role to connect to a database doesn’t cause an error when checking recovery
state.
11.36.1 Features
Issue #1344 - Allow the Query Tool, Debugger and web browser tabs to be moved to different monitors as desired
Issue #1533 - Set focus on the first enabled field when a dialogue is opened
Issue #1535 - Teach dialogues about Escape to cancel, Enter to Save/OK, and F1 for help
Issue #1971 - Retain column sizing in the Query Tool results grid when the same query is re-run multiple times in a
row
Issue #1972 - Prompt the user to save dirty queries rather than discard them for a more natural workflow
Issue #2137 - On-demand loading for the Query Tool results
Issue #2191 - Add support for the hostaddr connection parameter. This helps us play nicely with Kerberos/SSPI and
friends
Issue #2282 - Overhaul the query history tab to allow browsing of the history and full query text
Issue #2379 - Support inserting multiple new rows into a table without clicking Save for each row
Issue #2485 - Add a shortcut to reset the zoom level in the runtime
Issue #2506 - Allow the user to close the dashboard panel
Issue #2513 - Add preferences to enable brace matching and brace closing in the SQL editors
Issue #2013 - Increase the default size of the Grant Wizard to enable it to properly display privileges at the default
size on smaller displays
Issue #2014 - To fix unexpected behaviour displayed if user stops debugging on package/procedure fire_emp
Issue #2043 - Properly handle trigger functions with parameters
Issue #2078 - Refresh the SQL editor view on resize to ensure the contents are re-rendered for the new viewport
Issue #2086 - Allow editing of the WITH ADMIN option of role membership
Issue #2113 - Correct the validation logic when modifying indexes/exclusion constraints
Issue #2116 - Enable dialogue help buttons on Language and Foreign Table dialogues
Issue #2142 - Fix canceling of Grant Wizard on Windows
Issue #2155 - Fix removal of sizes from column definitions
Issue #2162 - Allow non-superusers to debug their own functions and prevent them from setting global breakpoints
Issue #2242 - Fix an issue in NodeAjaxControl caching with cache-node field and add cache-node field in Trigger &
Event trigger node so that whenever the user creates new Trigger Function we get new data from server in
NodeAjaxControl
Issue #2280 - Handle procedure flags (IMMUTABLE STRICT SECURITY DEFINER PARALLEL RESTRICTED)
properly in RE-SQL on EPAS
Issue #2324 - Fix the PostGIS Datatypes in SQL tab, Create / Update dialogues for Table, Column, Foreign Table and
Type node
Issue #2344 - Fix issue with ctrl-c / ctrl-v not working in Query Tool
Issue #2348 - Fix issue when resizing columns in Query Too/View Data where all row/colums will select/deselect
Issue #2355 - Properly refresh the parent node when renaming children
Issue #2357 - Cache statistics more reliably
Issue #2381 - Fix the RE-SQL for for views to properly qualify trigger function names
Issue #2386 - Display and allow toggling of trigger enable/disable status from the trigger dialogue
Issue #2398 - Bypass the proxy server for local addresses on Windows
Issue #2400 - Cleanup handling of default/null values when data editing
Issue #2414 - Improve error handling in cases where the user tries to rename or create a server group that would
duplicate an existing group
Issue #2417 - Order columns in multi-column pkeys correctly
Issue #2422 - Fix RE-SQL for rules which got the table name wrong in the header and DROP statement
Issue #2425 - Handle composite primary keys correctly when deleting rows in the Edit Grid
Issue #2426 - Allow creation of ENUM types with no members
Issue #2427 - Add numerous missing checks to ensure objects really exist when we think they do
Issue #2435 - Pass the database ID to the Query Tool when using the Script options
Issue #2436 - Ensure the last placeholder is included when generating UPDATE scripts for tables
Issue #2448 - Ensure that boolean checkboxes cycle values in the correct order
Issue #2450 - Fix error on the stats tab with PG10. Also, rename the 10.0_plus template directory to 10_plus to
match the new versioning
Issue #2461 - Allow users to remove default values from columns properly
Issue #2468 - Fix issue where function create script won’t compile
Issue #2470 - Fix an intermittent error seen during result polling
Issue #2476 - Improvements to the Query Results grid including improvements to the UI and allow copy/paste from
sets of rows, columns or arbitrary blocks of cells
Issue #2477 - Ensure text editors render in an appropriate place on the results grid
Issue #2479 - No need for the menu icon to link to the homepage, as pgAdmin is a SPA
Issue #2482 - Use a more sensible name for Query Tool tabs
Issue #2486 - Ensure the feature tests use the correct test settings database
Issue #2487 - Maintain a client-side cache of preference values, populated using an async call
11.37.1 Features
Issue #2225 - Hide menu options for creating objects, if the object type is set to hidden. Includes Jasmine tests
Issue #2253 - Fix various issues in CSV file download feature
Issue #2257 - Improve handling of nulls and default values in the data editor
Issue #2271 - Don’t change the trigger icon back to “enabled” when the trigger is updated when it’s disabled
Issue #2284 - Allow creation of tables with pure numeric names
Issue #2292 - Only reconnect to databases that were previously connected
Issue #2314 - Fix various issues in CSV file download feature
Issue #2315 - Fix sorting of sizes on the statistics views by sorting raw values and prettifying on the client side.
Includes Jasmine tests for the prettyfying function
Issue #2318 - Order foreign table columns correctly
Issue #2331 - Fix binary search algorithm so new treeview nodes are added in the correct position
Issue #2336 - Update inode info when refreshing treeview nodes.
Issue #2339 - Ensure the treeview can be scrolled horizontally
Issue #2350 - Fix handling of default parameters ordering in functions
Issue #2354 - Fix the Backup module where it was not working if user changes its preference language other than
English
Issue #2356 - Ensure errors thrown when deleting rows in the Query Tool in edit mode are shown properly
Issue #2360 - Fix various issues in CSV file download feature
Issue #2369 - Support loading files with Unicode BOMs
Issue #2377 - Update psycopg2 version for PostgreSQL 10 compatibility
Issue #2379 - Make various improvements to the NULL/DEFAULT handling in the data editor
Issue #2405 - Ensure object names are properly escaped for external process management
Issue #2410 - Fix PostgreSQL 10.0 compatibility issues
11.38.1 Features
Issue #2232 - Add the ability to gray-out/disable the “Save Password” option when creating a connection to a server
Issue #2261 - Display table DDL for Greenplum in SQL tab
Issue #2320 - Added German translation
Issue #2077 - Add missing “Run Now” option for pgAdmin jobs
Issue #2105 - Fix validation on the table dialogue so the Save button isn’t enabled if the name is removed and autovac
custom settings are enabled
Issue #2145 - Resolve the issue for restoring the table from the backup
Issue #2187 - Ensure the web/ directory is cleared before upgrading Windows installations
Issue #2190 - Allow users to select UI language at login or from Preferences rather than unpredictable behaviour
from browsers
Issue #2226 - Show tooltips for disabled buttons to help user learning
Issue #2241 - Fix numeric control validation in nested schemas
Issue #2243 - Fix dropping of databases with Unicode names
Issue #2244 - Prevent an error being displayed if the user views data on a table with no columns
Issue #2246 - Add missing braces to reverse engineered SQL header block for Functions
Issue #2258 - Fix handling of DATERANGE[] type
Issue #2264 - Resolve error message ExtDeprecationWarning displayed on new pgAdmin4 setup for Python 3.4 on
ubuntu 14.04 Linux 64
Issue #2265 - Resolved import/Export issue for a table
Issue #2274 - Properly handle truncated table names
Issue #2277 - Resolved various file-system encoding/decoding related cases
Issue #2281 - Ensure menus are updated after disconnecting a server
Issue #2283 - Check if cell is in multiselect mode before setting default selection of multiple values
Issue #2287 - Properly handle EXPLAIN queries entered directly by the user in the Query Tool
Issue #2291 - Fix error highlighting in the Query Tool
Issue #2299 - Fix usage of QString
Issue #2303 - Fix ascending/descending sort order in backgrid while clicking on the headers
Issue #2304 - Resolve the issue for restoring the table from the backup
Issue #2305 - Resolve the issue where Generic function qtLiteral was not adapting values properly when they contain
non ascii characters
Issue #2310 - Fix Dialog Help where Query Tool/Debugger opens in new browser tab
Issue #2319 - Resolve issue where Click on pgAdmin4 logo leads to unauthorized error
Issue #2321 - Improved functionality of browser tree when adding new nodes if parent collection node has not loaded
Issue #2330 - Ensure the Query Tool displays but does not render HTML returned by the server in the results grid
11.39.1 Features
Issue #2036 - Query tool efficiency - SlickGrid result set format efficiency
Issue #2038 - Query tool efficiency - Incremental back off when polling
Issue #2163 - Make syntax highlighting more visible
Issue #2210 - Build a universal Python wheel instead of per-python-version ones
Issue #2215 - Improve visibility of syntax highlighting colours
Issue #1796 - Add missing “Run Now” option for pgAdmin jobs
Issue #1797 - Resolve encoding issues with DATA_DIR
Issue #1914 - Resolved error utf8’ codec can’t decode byte
Issue #1983 - Fix bug in Sql query contains Arabic Charaters
Issue #2089 - Add PARALLEL SAFE|UNSAFE|RESTRICTED support
Issue #2115 - Fix exclusion constraint reverse engineered SQL
Issue #2119 - Fix display of long integers and decimals
Issue #2126 - Correct node labels in Preferences for EDB functions and procedures
Issue #2151 - Display un-sized varlen column types correctly in the Query Tool
Issue #2154 - Fix display of long integers and decimals
Issue #2159 - Resolve issue where Query editor is not working with Python2.6
Issue #2160 - Various encoding fixes to allow ‘ascii’ codec to decode byte 0xc3 in position 66: ordinal not in
range(128)
Issue #2166 - Resolved import/Export issue for a table
Issue #2173 - Resolved issues where Sequences API test cases are not working in PG9.2 and PPAS9.2
Issue #2174 - Resolved various file-system encoding/decoding related cases
Issue #2185 - Removed sorting columns on the treeview
Issue #2192 - Fix startup complete tests to ensure we properly poll the server for completed startup
Issue #2198 - Fix function arguments when generating create SQL
Issue #2200 - Properly handle event trigger functions in different schemas
Issue #2201 - Fix renaming of check constraints when the table name is changed at the same time
Issue #2202 - Fix issue where Dependents query fails due to non ascii characters
Issue #2204 - Fixed issue where pgadmin 4 jobs not showing any activity
Issue #2205 - Fix display of boolean nulls in the Query Tool
Issue #2208 - Ensure primary key column names are quoted in View Data mode of the Query Tool
Issue #2212 - Ensure servers are deleted when their parent group is deleted
Issue #2213 - Enable right click on browser tree
Issue #2218 - Show the correct indeterminate state when editing new boolean values
Issue #2228 - Authenticate the runtime to the server
Issue #2230 - Prevent the Slonik logo obscuring the login dialogue on small displays in server mode
11.40.1 Features
Issue #1227 - Display improved error message for Debugger listener starting error and reset between executions
Issue #1267 - Fix issue where MINIFY_HTML doesn’t work with the docs
Issue #1364 - Ensure dialogue control buttons are consistent
Issue #1394 - Fix Table dialogue column specification issues
Issue #1432 - Enhanced OSX File Browser
Issue #1585 - Cannot save scripts to the network
Issue #1599 - Ensure the grant wizard works with objects with special characters in the name
Issue #1603 - Fix quoting of objects names for external utilities.
Issue #1679 - Re-engineer the background process executor to avoid using sqlite as some builds of components it
relies on do not support working in forked children
Issue #1680 - Render column headers at the correct width in the Query Tool under Firefox
Issue #1729 - Improve display of role options
Issue #1730 - Improve the display of role membership on both the properties panel and role dialogue
Issue #1745 - Ensure breakpoints are cleared properly when working with Debugger
11.41.1 Features
Issue #1155 - Display the start value when the user creates sequence
Issue #1531 - Fix to update privileges for Views and Materials Views where “string indices must be integers error”
displayed
Issue #1574 - Display SQL in SQL pane for security label in PG and EPAS server
Issue #1576 - Make security label option available in procedure properties
Issue #1577 - Make debug option available for package function and procedure
Issue #1596 - Correct spelling error from evnt_turncate to evnt_truncate
Issue #1599 - Ensure the grant wizard works with objects with special characters in the name
Issue #1622 - Fix issue using special characters when creating synonym
Issue #1728 - Properties refreshing after objects are edited
Issue #1739 - Prevent the user from trying to. . . ..
Licence
pgAdmin is released under the PostgreSQL Licence, which is a liberal Open Source licence similar to BSD or MIT,
and approved by the Open Source Initiative. The copyright for the project source code, website and documentation is
attributed to the pgAdmin Development Team
pgAdmin 4
399
pgAdmin 4 Documentation, Release 4.25
401
pgAdmin 4 Documentation, Release 4.25
Master Password, 73 V
Materialized View Dialog, 152 View Dialog, 191
Menu Bar, 34 View/Edit Data, 303
Move Objects Dialog, 86 View/Edit Data Filter, 307
P
Package Dialog, 157
pgAdmin Project Contributions, 327
pgAgent, 313
Preferences Dialog, 45
Primary key Dialog, 221
Procedure Dialog, 160
Q
Query Tool, 290
Query Tool Toolbar, 291
R
Resource Group Dialog, 87
Restore Dialog, 279
RLS Policy Dialog, 224
Rule Dialog, 227
S
Schema Dialog, 166
Schema Diff, 307
Search objects, 64
Sequence Dialog, 169
Server Deployment, 16
Server Dialog, 68
Server Group Dialog, 67
Submitting Patches, 327
Synonym Dialog, 173
T
Tabbed Browser, 38
Table Dialog, 230
Tablespace Dialog, 94
The config.py File, 4
Toolbar, 37
Translations, 346
Tree Control, 42
Trigger Dialog, 250
Trigger Function Dialog, 175
Type Dialog, 181
U
Unique Constraint Dialog, 255
User Interface, 33
User Management Dialog, 28
User Mapping Dialog, 189
Using pgAgent, 313
402 Index