修复pg_dump将索引等当作序列导出的问题

This commit is contained in:
luozihao
2023-12-26 14:45:43 +08:00
parent eae6e7af75
commit e09bdccede

View File

@ -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) {