Disclosure: I build Schemity, a desktop ERD tool - this post is from our blog and uses it for the examples.

TL;DR: Ask the catalogue for foreign keys whose referenced table is yours: pg_constraint.confrelid in PostgreSQL, REFERENCED_TABLE_NAME in MySQL, sys.foreign_keys.referenced_object_id in SQL Server, and pragma_foreign_key_list across every table in SQLite. Then check two things the list does not tell you: whether a key appears once per partition, and whether it still enforces anything, because disabled and unvalidated keys are listed like the rest.

To find the tables that reference a table, ask the database's catalogue for foreign keys whose referenced table is yours. Every engine records that, but each stores it differently, and the answer it gives back has two traps: some engines list one foreign key several times, and most engines can list keys that enforce nothing. A third gap is a reference nobody declared, which no catalogue can show.

Everything below was run in throwaway containers on PostgreSQL 18.3, MySQL 8.4.11 and SQL Server 2022 (CU26), and with the sqlite3 3.54.0 shell, against a customers table with orders, addresses and a payments table in a second schema pointing at it.

How to find which tables reference a table

Query the foreign keys whose target is your table: one catalogue lookup per engine, with SQLite as the exception that has to scan every table.

Database Where incoming keys are recorded The ON DELETE action Quick look
PostgreSQL pg_constraint.confrelid confdeltype, or pg_get_constraintdef psql \d customers, under Referenced by
MySQL information_schema.KEY_COLUMN_USAGE.REFERENCED_TABLE_NAME REFERENTIAL_CONSTRAINTS.DELETE_RULE none: SHOW CREATE TABLE shows only outgoing keys
SQL Server sys.foreign_keys.referenced_object_id delete_referential_action_desc EXEC sp_fkeys @pktable_name = 'customers', with the rule as a number (0 is CASCADE) and no disabled flag
SQLite nowhere: each table lists only its own keys pragma_foreign_key_list(...).on_delete none

The queries, one per engine:

-- PostgreSQL SELECT conrelid::regclass AS referencing_table, conname, pg_get_constraintdef(oid) AS definition, convalidated FROM pg_constraint WHERE contype = 'f' AND confrelid = 'customers'::regclass AND conparentid = 0 ORDER BY 1; -- MySQL SELECT k.TABLE_SCHEMA, k.TABLE_NAME, k.CONSTRAINT_NAME, k.COLUMN_NAME, r.DELETE_RULE FROM information_schema.KEY_COLUMN_USAGE k JOIN information_schema.REFERENTIAL_CONSTRAINTS r ON r.CONSTRAINT_SCHEMA = k.CONSTRAINT_SCHEMA AND r.CONSTRAINT_NAME = k.CONSTRAINT_NAME WHERE k.REFERENCED_TABLE_SCHEMA = 'shop' AND k.REFERENCED_TABLE_NAME = 'customers' ORDER BY k.TABLE_SCHEMA, k.TABLE_NAME, k.ORDINAL_POSITION; -- SQL Server SELECT OBJECT_SCHEMA_NAME(parent_object_id) AS referencing_schema, OBJECT_NAME(parent_object_id) AS referencing_table, name, delete_referential_action_desc, is_disabled, is_not_trusted FROM sys.foreign_keys WHERE referenced_object_id = OBJECT_ID('dbo.customers'); 

All three found the key from payments in the other schema, because they filter on the referenced table, not on the referencing one. On MySQL that is a second database, billing.payments, listed with DELETE_RULE NO ACTION, the rule MySQL records when none is written. A column declared with only an inline customer_id BIGINT REFERENCES customers (id) did not appear at all, because MySQL 8.4 accepts that clause and creates no key, as the post on checking migrations in CI measured.

Why does the same foreign key appear three times in PostgreSQL?

Because PostgreSQL copies a foreign key onto every partition of a partitioned table, and the copies are rows in pg_constraint too.

With orders partitioned by year into orders_2025 and orders_2026, the same lookup without conparentid = 0, selecting confdeltype for the action, returned five rows for customers where there are three keys:

 referencing | conname | confdeltype ------------------+----------------------------+------------- orders | orders_customer_id_fkey | r orders_2025 | orders_customer_id_fkey | r orders_2026 | orders_customer_id_fkey | r addresses | addresses_customer_id_fkey | c billing.payments | payments_customer_id_fkey | a 

A key into a partitioned table is copied too, the other way round. The key from invoices into orders is stored three times, once pointing at orders and once at each partition, so the incoming list for orders shows it once, but invoices shows three outgoing keys and each partition shows one incoming key. Each copy names its original in conparentid, so keeping only conparentid = 0 returns one row per key in every direction:

orders_customer_id_fkey (orders -> customers) ├── copy on orders_2025 └── copy on orders_2026 invoices_order_id_order_created_at_fkey (invoices -> orders) ├── ..._fkey_1, pointing at orders_2025 └── ..._fkey_2, pointing at orders_2026 

psql's \d customers already hides them: its Referenced by section listed addresses, orders and billing.payments once each, and marked the unvalidated key NOT VALID. The 'customers'::regclass cast resolves the name through search_path, so qualify it ('public.customers'::regclass) when another schema has a table of the same name.

SQLite: why is there no reverse lookup?

SQLite stores each foreign key only in the CREATE TABLE of the table that declares it, so finding the incoming ones means reading every table's list.

SELECT m.name AS referencing_table, p."from" AS column_name, p."to" AS referenced_column, p.on_delete FROM sqlite_schema m JOIN pragma_foreign_key_list(m.name) p WHERE m.type = 'table' AND p."table" = 'customers' COLLATE NOCASE ORDER BY m.name; 

The COLLATE NOCASE matters. The referenced name is stored as written, and addresses had been declared with REFERENCES Customers (id); a plain = 'customers' returned only orders. A key pointing at a table that does not exist, such as a typo REFERENCES customer (id), is accepted by CREATE TABLE and simply never matches. The SQLite foreign key documentation explains the other catch: enforcement is off unless each connection runs PRAGMA foreign_keys = ON, and with it off an orders row pointing at customer 42, who did not exist, went in without a complaint.

Which listed foreign keys actually enforce anything?

Not all of them: PostgreSQL lists unvalidated keys, SQL Server lists disabled and untrusted keys, and MySQL and SQLite keep no record of rows written with checks off, so read the state columns before trusting the list.

Database State to check What it means Measured
PostgreSQL convalidated = false (added NOT VALID) New rows are checked; existing rows never were An address pointing at customer 99 stayed after the key was added
PostgreSQL 18 conenforced = false (NOT ENFORCED) Nothing is checked
SQL Server is_disabled = 1 (NOCHECK CONSTRAINT) No check and no action A disabled CASCADE key left the address behind when its customer was deleted
SQL Server is_not_trusted = 1 (added WITH NOCHECK) Checked from now on; rows already there never were payments kept a row pointing at customer 99
MySQL foreign_key_checks = 0 on the session, with no flag in the catalogue Rows written while it was off were never checked An orphan address went in while TABLE_CONSTRAINTS.ENFORCED still said YES
SQLite PRAGMA foreign_keys on the connection Off by default, per connection An orphan order inserted with it off

The SQL Server case is the one that misleads most. sys.foreign_keys reported the disabled key on addresses with delete_referential_action_desc CASCADE (and is_not_trusted = 1, as every disabled key has). Deleting customer 2 succeeded and left address 6 holding customer_id = 2, a customer that no longer existed. Anyone reading the catalogue to answer "what does deleting a customer take with it" would have been told the addresses go too.

There is also what no catalogue records: a reference nobody declared. A Rails or Django app that never added the constraint still has orders.customer_id meaning a customer, and the queries above return nothing for it. Finding those is a different job, covered in whether to use foreign key constraints, which also shows how to count the orphans before declaring one.

How does Schemity show the keys pointing at a table?

Schemity lists the foreign keys in the diagram that point at a table in that table's Keys tab, once each, with their columns and their ON DELETE and ON UPDATE actions.

Schemity is database design software that reads your live database, shows the impact of every schema change before it runs, and keeps the diagram as a file in Git. Open a table and the read-only Keys tab of its drawer shows up to three lists: the primary key, the foreign keys the table declares, and Referenced by, the keys in other tables that point at it. A key the database does not enforce is tagged NOT ENFORCED, and a relation you drew yourself for a reference nobody declared is tagged virtual (see virtual relations). Selecting a table on the canvas draws every relation touching it at double weight, which is the same answer as a picture. That is the point of reading a live database to understand your schema: the list comes from the catalogue, not from someone's memory of it.

Schemity's Keys tab for the customers table on PostgreSQL 18.3: the primary key customers_pkey on id, and under Referenced by two foreign keys, addresses_customer_id_fkey on addresses(customer_id) with CASCADE on delete and NO ACTION on update, and orders_customer_id_fkey on orders(customer_id) with RESTRICT and NO ACTION, each listed once although orders is partitioned; the footer counts 4 entities and 3 relations.

Checking this post's partitioned orders table found a bug. Schemity read only ordinary tables, so the partitioned parent was missing from the diagram, each partition showed up as a table of its own, and every key was drawn once per partition, the same repetition as the naive query above. In the next release a partitioned table is read as one table: its columns, keys, checks and indexes once, its row count and size summed across its partitions, and the views that read it listed as its dependents for impact analysis.

Schemity's canvas on PostgreSQL 18.3 with the customers table selected: the partitioned orders table appears once, with created_at, id and customer_id and no orders_2025 or orders_2026, next to invoices and addresses; the relations from customers to orders and to addresses are drawn at double weight, and the footer counts 4 entities and 3 relations.

What the Keys tab does not show matters as much. It lists keys between tables of the diagram's schema; a key from another schema, like billing.payments, is read as a dependent for impact analysis but does not appear under Referenced by. A PostgreSQL key added NOT VALID and a SQL Server key that is disabled or untrusted are shown as ordinary keys, so the disabled CASCADE above would read as a cascade. Schemity does not yet know a table's partition key, so it does not warn that PostgreSQL refuses a UNIQUE constraint on a partitioned table without it. And a reference nobody declared shows only if you draw it. Impact analysis reads the database, not your application, so an empty Referenced by list is not proof that nothing reads the table.

Before you rely on the list

Run the catalogue query, then read the state of each key it returns, then ask what it cannot contain.

On PostgreSQL filter conparentid = 0 and look at convalidated; on SQL Server look at is_disabled and is_not_trusted; on SQLite compare names without case and remember enforcement is per connection; on MySQL filter on the referenced schema so keys from other databases come back too. Then look for the references nobody declared, because the catalogue only knows what was written down. For what happens when one of those keys fires, see ON DELETE RESTRICT vs NO ACTION and what DROP TABLE CASCADE drops in PostgreSQL.