Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Databases and Redis

A table you created does not appear in the pgAdmin 4 browser tree

ErrorTable created, but not shown under Schemas > public > Tables

Short answer

The table usually exists; the tree is showing something else. Refresh the Tables node first. If it is still absent, the table went into another schema or database than the one you are looking at, or the tree hides it. Query the catalog to see where it really is.

  • Applies to pgAdmin 4 9.x, PostgreSQL 17, PostgreSQL 18
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Ask the database where the table really is, ignoring the tree.

    SELECT table_schema, table_name FROM information_schema.tables
    WHERE table_name = 'my_table';
  2. 2Match what you see, then jump to its fix

    1. 1The query above finds the table in the schema you expectedThe tree has not been refreshedFix
    2. 2The query returns a schema other than the one you opened in the treeThe table was created in another schemaFix
    3. 3The first-step query finds nothing at all when run from the database you are browsingThe Query Tool was connected to a different databaseFix
    4. 4The table is found by the query, in the right schema, and refresh does not show itThe tree hides the object type or the databaseFix

What does the error look like?

  • Table created, but not shown under Schemas > public > Tables
  • CREATE TABLE succeeded in the Query Tool, tree unchanged

Cause 1 of 4

The tree has not been refreshed

1Check

The tree may still show the list it loaded before your CREATE TABLE ran. Refresh asks the server for the current state of the selected object.

-- in the tree: right-click Tables

2Fix

Right-click the Tables node (or the schema, or the database) and choose Refresh.

-- Tables > right-click > Refresh...

3Verify

The table appears under Tables.

SELECT to_regclass('public.my_table');

Confirmed by pgadmin.org

Did this fix it?

Cause 2 of 4

The table was created in another schema

1Check

A CREATE TABLE without a schema name goes into the first schema of search_path, which is not always public (a schema named after your user comes first by default).

SHOW search_path;

2Fix

Look under that schema in the tree, or move the table to the schema you want.

ALTER TABLE my_user.my_table SET SCHEMA public;

3Verify

The table is now listed in public.

SELECT table_schema FROM information_schema.tables WHERE table_name = 'my_table';

Confirmed by postgresql.org

Did this fix it?

Cause 3 of 4

The Query Tool was connected to a different database

1Check

Each connection works in one database. A table made while connected to postgres does not exist in my_db.

SELECT current_database();

2Fix

Run CREATE TABLE again in the right database, or open a Query Tool from that database's own context menu.

-- Tree: right-click my_db > Query Tool

3Verify

current_database() returns the database you browse.

SELECT current_database();

Confirmed by postgresql.org

Did this fix it?

Cause 4 of 4

The tree hides the object type or the database

1Check

With Show empty object collections turned off, empty collections are hidden, and the server's DB restriction limits which databases are listed.

-- File > Preferences > Browser > Display ; Server > Properties > Advanced > DB restriction

2Fix

Turn Show empty object collections on, and clear or correct the DB restriction field.

-- Preferences > Browser > Display > Show empty object collections = on

3Verify

Reconnect the server; the collection and database are visible.

-- Tree shows Tables under the schema

Confirmed by pgadmin.org

Did this fix it?

How do I stop it coming back?

  • Write the schema in every CREATE TABLE (public.my_table) so it never depends on search_path.
  • Check the database name above the Query Tool tab before you run DDL.
  • Refresh the node after DDL run outside the tree.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Related fixes

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.