Try PostgreSQL 19 CREATE PUBLICATION ... FOR ALL TABLES EXCEPT from a Desktop GUI
PostgreSQL 19 lets CREATE PUBLICATION ... FOR ALL TABLES EXCEPT leave named tables out of a database-wide publication. Run that SQL and inspect pg_publication / pg_publication_rel in HiDataLinker — the app has no publication wizard and does not manage subscriptions.
正文目前为英文。
On 19 November 2026 the PostgreSQL Global Development Group announced PostgreSQL 19. The 19.0 release notes add the ability for CREATE PUBLICATION and ALTER PUBLICATION to exclude some tables. That is the EXCEPT clause, and the notes say it is useful when specifying ALL TABLES.
This guide shows how to create that kind of publication — and inspect what it actually includes — from HiDataLinker, a free MIT PostgreSQL desktop GUI (MySQL in the same client): local-first credentials, URL paste, Dump / same-engine migrate, and no seat, connection, or tab freemium wall.
These statements require a PostgreSQL 19+ server (SELECT version();). On older majors, FOR ALL TABLES EXCEPT is not documented syntax.
This page is about excluding tables from a FOR ALL TABLES publication. It is not a walkthrough of enabling logical replication without a restart (wal_level / effective_wal_level), and it is not about CREATE PUBLICATION ... FOR ALL SEQUENCES.
What HiDataLinker actually ships
HiDataLinker v1.3.0 includes a SQL editor and a result grid. Paste a postgresql:// URL or DATABASE_URL, keep the profile on your machine, and run CREATE PUBLICATION, ALTER PUBLICATION, and catalog queries yourself.
It does not ship a publication wizard, a logical-replication GUI, or in-app controls for subscriptions, slots, or postgresql.conf. It cannot restart the server or change wal_level. The PostgreSQL 19 server stores the publication; the desktop client only sends the SQL and displays the result.
1. Connect to a PostgreSQL 19 server
- Install from hidatalinker.onesolo.app.
- Open New Connection — paste the URI or fill host, port, user, password, and database. See paste a DATABASE_URL.
- Test, then connect. Profiles stay on your machine — local-first, no hosted workspace.
- In the SQL editor, run
SELECT version();and confirm you are on PostgreSQL 19 or newer.
Creating a publication does not start replication. Official CREATE PUBLICATION docs say it only defines grouping and filtering logic for future subscribers. You still need a publication name that does not already exist in the current database, and the tables you list in EXCEPT must already exist.
2. Create a FOR ALL TABLES EXCEPT publication
Official docs require the invoking user to be a superuser for FOR ALL TABLES (the same rule applies to FOR TABLES IN SCHEMA and FOR ALL SEQUENCES). Having CREATE on the database is not enough for this clause.
In the SQL editor (⌘/Ctrl+Enter), use the documented shape — and replace the example table names with tables you actually intend to leave out:
CREATE PUBLICATION all_tables_except
FOR ALL TABLES EXCEPT (TABLE users, departments);
That marks the publication as one that replicates changes for all tables in the database, including tables created in the future, except the tables listed in EXCEPT. Temporary tables, unlogged tables, foreign tables, materialized views, and regular views still cannot be part of a publication.
FOR ALL TABLES and FOR ALL SEQUENCES can be combined in one command if you also want sequence synchronization; that is a separate PostgreSQL 19 feature, and this page does not walk through sequence refresh.
If you only wanted to see the statement succeed, drop the publication you created. Do not drop a publication you did not create, or one that a subscriber still uses:
DROP PUBLICATION all_tables_except;
3. Inspect pg_publication, exclusions, and the published set
pg_publication stores the publication. For a FOR ALL TABLES publication, puballtables is true. The exclusion list itself is not a column on that catalog; official docs put it on pg_publication_rel, where prexcept is true when the table is excluded via EXCEPT.
SELECT pubname, puballtables, puballsequences,
pubinsert, pubupdate, pubdelete, pubtruncate
FROM pg_publication
WHERE pubname = 'all_tables_except';
SELECT n.nspname AS schemaname, c.relname AS tablename
FROM pg_publication_rel pr
JOIN pg_publication p ON p.oid = pr.prpubid
JOIN pg_class c ON c.oid = pr.prrelid
JOIN pg_namespace n ON n.oid = c.relnamespace
WHERE p.pubname = 'all_tables_except'
AND pr.prexcept
ORDER BY 1, 2;
The user-facing view pg_publication_tables expands a FOR ALL TABLES publication to a row for each eligible table. It has no prexcept column, so use it to review what is published, and use pg_publication_rel for the exclusion list. In a database with many tables, add a filter or LIMIT — HiDataLinker's result grid caps unsized queries at about 500 rows, with a hard cap of about 5,000.
SELECT schemaname, tablename
FROM pg_publication_tables
WHERE pubname = 'all_tables_except'
AND schemaname NOT IN ('pg_catalog', 'information_schema')
ORDER BY 1, 2
LIMIT 100;
A table that appears in the prexcept query should not appear as an eligible row for that publication in pg_publication_tables.
4. Change the EXCEPT list later
ALTER PUBLICATION ... SET ALL TABLES can replace the exclusion list, or clear it. Official docs say SET ALL TABLES also requires a superuser.
-- Replace the exclusion list
ALTER PUBLICATION all_tables_except
SET ALL TABLES EXCEPT (TABLE users, departments);
-- Clear the exclusion list (still FOR ALL TABLES)
ALTER PUBLICATION all_tables_except
SET ALL TABLES;
If a subscription already uses the publication, official docs require ALTER SUBSCRIPTION ... REFRESH PUBLICATION on the subscriber before the new EXCEPT list (or a switch to ALL TABLES) takes effect. HiDataLinker has no subscription-management UI; that refresh is ordinary SQL you run on the subscriber connection, only if you intend to change a live subscription.
Official limits
FOR ALL TABLES,FOR TABLES IN SCHEMA, andFOR ALL SEQUENCESrequire a superuser.SET ALL TABLESdoes too. The new owner of aFOR ALL TABLESpublication must also be a superuser.- Once a table is excluded, the exclusion applies to that table regardless of its name or schema. Renaming it, or moving it with
ALTER TABLE ... SET SCHEMA, does not remove the exclusion. - For partitioned tables, only the root partitioned table may appear in
EXCEPT. That excludes the root and all of its partitions. The optionalONLYand*have no effect on partitioned tables. For inherited tables,ONLYexcludes just that table; omittingONLYexcludes the table and its descendants. - If a subscription includes multiple publications, a table or partition included in one publication but excluded (explicitly or implicitly) by
EXCEPTin another is considered included for replication. - Creating a publication does not start replication, and DDL is not published. Tables that publish
UPDATEorDELETEstill need aREPLICA IDENTITY. - Changing the
EXCEPTlist on a publication that already has subscribers requires a refresh on the subscribing side. HiDataLinker does not perform that refresh for you. - These clauses are PostgreSQL 19+; older servers will reject the syntax.
HiDataLinker is a thin Tauri desktop app for PostgreSQL and MySQL — paste DATABASE_URL, keep creds local, and avoid seat / connection / tab freemium walls. Honest v1: MySQL + PostgreSQL as marketed; not a publication wizard, logical-replication console, GUC editor, or subscription manager. Overview: /db-client.
Soft next step
Need a desktop GUI that can run CREATE PUBLICATION ... FOR ALL TABLES EXCEPT and query pg_publication / pg_publication_rel on PostgreSQL 19, without a freemium wall?
- Download: https://hidatalinker.onesolo.app/
- Source: https://github.com/henrybit/HiDataLinker