select tab.table_schema,
tab.table_name
from information_schema.tables tab
left join information_schema.table_constraints tco
on tab.table_schema = tco.table_schema
and tab.table_name = tco.table_name
and tco.constraint_type = 'PRIMARY KEY'
where tab.table_type = 'BASE TABLE'
and tab.table_schema not in ('pg_catalog', 'information_schema', 'pglogical')
and tco.constraint_name is null
order by table_schema,
table_name;
SELECT schemaname,
relname,
n_tup_ins,
n_tup_upd,
n_tup_del
FROM pg_stat_user_tables
WHERE schemaname NOT IN
('pglogical', 'pg_catalog', 'information_schema');
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-08-18 UTC。"],[[["\u003cp\u003eThis page provides debugging scripts and guidance for using AlloyDB, particularly focusing on data migration from PostgreSQL.\u003c/p\u003e\n"],["\u003cp\u003eDatabase Migration Service supports the initial snapshot and \u003ccode\u003eINSERT\u003c/code\u003e statements for tables without primary keys during migration, but manual steps are needed for \u003ccode\u003eUPDATE\u003c/code\u003e and \u003ccode\u003eDELETE\u003c/code\u003e operations.\u003c/p\u003e\n"],["\u003cp\u003eYou can detect potential data discrepancies between the source and destination by identifying tables without primary keys and tracking \u003ccode\u003eINSERT\u003c/code\u003e, \u003ccode\u003eUPDATE\u003c/code\u003e, and \u003ccode\u003eDELETE\u003c/code\u003e activity using queries against \u003ccode\u003einformation_schema\u003c/code\u003e and \u003ccode\u003epg_stat_user_tables\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eIf discrepancies are detected, manual migration options include comparing data and running SQL queries, utilizing \u003ccode\u003epg_dump\u003c/code\u003e and \u003ccode\u003epg_restore\u003c/code\u003e, or employing the Postgres \u003ccode\u003eCOPY\u003c/code\u003e command, which might require pre-migration data cleanup on the replica.\u003c/p\u003e\n"]]],[],null,[]]