Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5209c0b

Browse files
committed
Refactor pg_dump's tracking of object components to be dumped.
Split the DumpableObject.dump bitmask field into separate bitmaskstracking which components are requested to be dumped (in theexisting "dump" field) and which components exist for the particularobject (in the new "components" field). This gets rid of someklugy and easily-broken logic that involved setting bits and laterclearing them. More importantly, it restores the originally intendedbehavior that pg_dump's secondary data-gathering queries should notbe executed for objects we have no interest in dumping. Thatoptimization got broken when the dump flag was turned into a bitmask,because irrelevant bits tended to remain set in many cases. Sincethe "components" field starts from a minimal set of bits and isadded onto as needed, ANDing it with "dump" provides a reliableindicator of what we actually have to dump, without having tocomplicate the logic that manages the request bits. This makesa significant difference in the number of queries needed when,for example, there are many functions in extensions.Discussion:https://postgr.es/m/2273648.1634764485@sss.pgh.pa.usDiscussion:https://postgr.es/m/7d7eb6128f40401d81b3b7a898b6b4de@W2012-02.nidsa.loc
1 parente9e63b7 commit5209c0b

File tree

3 files changed

+351
-280
lines changed

3 files changed

+351
-280
lines changed

‎src/bin/pg_dump/common.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,8 @@ AssignDumpId(DumpableObject *dobj)
584584
dobj->namespace=NULL;/* may be set later */
585585
dobj->dump=DUMP_COMPONENT_ALL;/* default assumption */
586586
dobj->dump_contains=DUMP_COMPONENT_ALL;/* default assumption */
587+
/* All objects have definitions; we may set more components bits later */
588+
dobj->components=DUMP_COMPONENT_DEFINITION;
587589
dobj->ext_member= false;/* default assumption */
588590
dobj->depends_on_ext= false;/* default assumption */
589591
dobj->dependencies=NULL;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp