From e09bdccede369826589aecbd35bf336c9ffd321d Mon Sep 17 00:00:00 2001 From: luozihao <1165977584@qq.com> Date: Tue, 26 Dec 2023 14:45:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dpg=5Fdump=E5=B0=86=E7=B4=A2?= =?UTF-8?q?=E5=BC=95=E7=AD=89=E5=BD=93=E4=BD=9C=E5=BA=8F=E5=88=97=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/bin/pg_dump/pg_dump.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bin/pg_dump/pg_dump.cpp b/src/bin/pg_dump/pg_dump.cpp index c3d264139..54871b0da 100644 --- a/src/bin/pg_dump/pg_dump.cpp +++ b/src/bin/pg_dump/pg_dump.cpp @@ -23644,7 +23644,9 @@ static void dumpTableAutoIncrement(Archive* fout, PQExpBuffer sqlbuf, TableInfo* "pg_class c left join pg_namespace n on c.relnamespace = n.oid " "left join pg_depend d on c.oid = d.objid " "where classid = %u and deptype = '%c' and refobjid = %u and refobjsubid = %u " - ,RelationRelationId, DEPENDENCY_AUTO, tbinfo->dobj.catId.oid, tbinfo->autoinc_attnum); + "and c.relkind in ('%c', '%c')" + ,RelationRelationId, DEPENDENCY_AUTO, tbinfo->dobj.catId.oid, tbinfo->autoinc_attnum + ,RELKIND_SEQUENCE, RELKIND_LARGE_SEQUENCE); res = ExecuteSqlQuery(fout, query->data, PGRES_TUPLES_OK); if (PQntuples(res) != 1) {