Skip to content

Introduction ​

phpPgAdmin is a web application for administering PostgreSQL 13 and newer. It looks and behaves like phpMyAdmin, and covers the PostgreSQL objects and tools that pgAdmin 4 covers. This page explains what it is, what it needs, and how its pages are organised.

The phpPgAdmin window at a table's Structure page, with its parts numbered: 1 panel header, 2 tree controls, 3 navigation tree, 4 panel collapser, 5 breadcrumb, 6 tab bar, 7 user menu, 8 page, 9 console bar

  1. The navigation panel header: logo and the Home, Log out and documentation links.
  2. The tree controls: Collapse all and Link with main panel.
  3. The navigation tree: databases, then the objects inside each one.
  4. The arrow that collapses and expands the navigation panel.
  5. The breadcrumb: server, database, schema and table of the page you are on.
  6. The tab bar of that level.
  7. The user menu.
  8. The page itself.
  9. The console bar.

Finding your way around describes each part.

What it is ​

  • The phpMyAdmin interface. The layout, the pmahomme theme, the tab names, the "With selected:" lists, the confirmation dialogs and the settings pages follow phpMyAdmin 5.2. If you know phpMyAdmin, you already know where most things are.
  • pgAdmin's coverage of PostgreSQL. Schemas, partitions, inheritance, materialized views, procedures, domains, range and composite types, collations, full text search, extensions, foreign data wrappers, publications and subscriptions, row-level security, event triggers and more. Most create and alter forms can show the SQL they will run before they run it.
  • A plain PHP application. PHP 8.3 with the pgsql extension, behind any web server. There is no agent or daemon to run, and nothing to install on the database server. You sign in with a PostgreSQL role, and every statement runs as that role, so PostgreSQL's own privileges decide what you can do.

How it compares ​

phpMyAdminpgAdmin 4phpPgAdmin
DatabaseMySQL, MariaDBPostgreSQLPostgreSQL 13+
Runs asPHP web appPython web app or desktop appPHP web app
Sign-inDatabase accountIts own user accounts, then a saved password per serverPostgreSQL role, per session
InterfaceTabs per level, navigation treeObject browser with dialogsphpMyAdmin's tabs and tree
Own storageOptional configuration storage databaseSQLite pgadmin4.dbSQLite file in storage/

Not the classic phpPgAdmin

This is a new application. Its configuration (config/*.php and PGADMIN_* environment variables) has nothing in common with the classic phpPgAdmin's conf/config.inc.php, so a classic installation cannot be upgraded in place. Compared with the classic phpPgAdmin sets the two side by side.

The object hierarchy ​

PostgreSQL has one more level than MySQL: a database holds schemas, and tables, views, functions and types live in a schema. The interface follows that hierarchy. Each level has its own address, breadcrumb entry and tab bar:

LevelAddressBreadcrumbExample
Server/server/<tab>Server: host:port/server/roles
Database/db/<database>/<tab>Database: name/db/bookshop/search
Schema/db/<database>/schema/<schema>/<tab>Schema: name/db/bookshop/schema/public/routines
Table, view, materialized view/db/<database>/schema/<schema>/table/<name>/<tab> (view/, mview/)Table:, View: or Materialized view: name/db/bookshop/schema/public/table/books/ddl

Every page has an address you can bookmark, reload or open in a new browser tab.

One connection per database

PostgreSQL connections belong to one database, so phpPgAdmin opens a connection to each database you work in. Objects that belong to the whole cluster (roles, tablespaces, databases, replication) are on the server level. Objects inside a database (schemas, extensions, casts, event triggers, publications) are on the database level.

What you can do ​

Getting started: Installation, Configuration, Signing in, Finding your way around, Known limitations.

Server level

  • Databases: list, create and drop databases, with their sizes.
  • Status and monitoring: server activity, sessions with cancel and terminate, locks, prepared transactions and live charts.
  • Server logs: read the server's log files.
  • Roles: create and edit roles and memberships.
  • Tablespaces: create, edit and drop tablespaces.
  • Replication: replication slots, standbys, publications and subscriptions.
  • Variables: the server's configuration parameters.
  • Settings: your own phpPgAdmin preferences.

Database level

  • Schemas: the schemas of a database.
  • Database operations: rename, change the owner or settings, copy, and run maintenance.
  • Search: find text in every table of a database.
  • Extensions and other objects: extensions, casts, languages, event triggers and the other database-wide objects.
  • Foreign data: foreign data wrappers, servers, user mappings and foreign tables.
  • Designer: an ER diagram you can edit.
  • Schema diff: compare two schemas and get the migration script.

Schema level

Table level

Tools

Requirements ​

ComponentRequirement
PostgreSQL server13 or newer.
PHP8.3 or newer, with the pgsql, pdo_sqlite, mbstring, ctype, zlib and session extensions. proc_open and exec must not be disabled.
Web serverAny server that can run PHP: nginx with PHP-FPM, Apache, or PHP's built-in server for local use. phpPgAdmin must be served from the root of a host name.
PostgreSQL client programspg_dump, pg_dumpall, pg_restore and psql, for Export, Import and Maintenance. Everything else works without them.
BrowserA current browser with JavaScript enabled. Without JavaScript the page stays blank.
OptionalThe pgstattuple extension for more table statistics; the pldbgapi extension and shared_preload_libraries = 'plugin_debugger' for the Debugger.

Installation has the details. On your own Linux or macOS machine, phnx setup phppgadmin with phnx installs and serves it in one step.

Older PostgreSQL versions

The SQL phpPgAdmin sends is written for PostgreSQL 13 and newer. Signing in to an older server is not refused, but pages may fail with SQL errors.

Known limitations ​

Some controls are drawn but their feature is not built yet. They look like working controls, as in phpMyAdmin, and answer with the notice Not available yet. when you use them. Known limitations lists them, along with other gaps.

Released under the MIT License.