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

Commit5423853

Browse files
committed
Avoid retrieval of CHECK constraints and DEFAULT exprs in data-only dump
Those extra queries are not necessary when doing a data-only dump. Withthis change, this means that the dependencies between CHECK/DEFAULT andthe parent table are not tracked anymore for a data-only dump. However,these dependencies are only used for the schema generation and we havenever guaranteed that a dump can be reloaded if a CHECK constraint usesa custom function whose behavior changes when loading the data, likewhen using cross-table references in the CHECK function.Author: Julien RouhaudReviewed-by: Daniel Gustafsson, Michael PaquierDiscussion:https://postgr.es/m/20200712054850.GA92357@nol
1 parentc8aeaf3 commit5423853

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

‎src/bin/pg_dump/pg_dump.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8644,9 +8644,10 @@ getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables)
86448644
PQclear(res);
86458645

86468646
/*
8647-
* Get info about column defaults
8647+
* Get info about column defaults. This is skipped for a data-only
8648+
* dump, as it is only needed for table schemas.
86488649
*/
8649-
if (hasdefaults)
8650+
if (!dopt->dataOnly &&hasdefaults)
86508651
{
86518652
AttrDefInfo *attrdefs;
86528653
intnumDefaults;
@@ -8731,9 +8732,10 @@ getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables)
87318732
}
87328733

87338734
/*
8734-
* Get info about table CHECK constraints
8735+
* Get info about table CHECK constraints. This is skipped for a
8736+
* data-only dump, as it is only needed for table schemas.
87358737
*/
8736-
if (tbinfo->ncheck > 0)
8738+
if (!dopt->dataOnly &&tbinfo->ncheck > 0)
87378739
{
87388740
ConstraintInfo *constrs;
87398741
intnumConstrs;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp