13
13
*
14
14
*-------------------------------------------------------------------------
15
15
*/
16
+ #include "postgres_fe.h"
17
+
16
18
#include "pg_backup_archiver.h"
17
19
#include "pg_backup_utils.h"
20
+ #include "pg_dump.h"
18
21
19
22
#include <ctype.h>
20
23
@@ -64,7 +67,7 @@ static DumpableObject **nspinfoindex;
64
67
65
68
static void flagInhTables (TableInfo * tbinfo , int numTables ,
66
69
InhInfo * inhinfo , int numInherits );
67
- static void flagInhAttrs (TableInfo * tblinfo , int numTables );
70
+ static void flagInhAttrs (DumpOptions * dopt , TableInfo * tblinfo , int numTables );
68
71
static DumpableObject * * buildIndexArray (void * objArray , int numObjs ,
69
72
Size objSize );
70
73
static int DOCatalogIdCompare (const void * p1 , const void * p2 );
@@ -78,7 +81,7 @@ static int strInArray(const char *pattern, char **arr, int arr_size);
78
81
* Collect information about all potentially dumpable objects
79
82
*/
80
83
TableInfo *
81
- getSchemaData (Archive * fout , int * numTablesPtr )
84
+ getSchemaData (Archive * fout , DumpOptions * dopt , int * numTablesPtr )
82
85
{
83
86
ExtensionInfo * extinfo ;
84
87
InhInfo * inhinfo ;
@@ -114,19 +117,19 @@ getSchemaData(Archive *fout, int *numTablesPtr)
114
117
*/
115
118
if (g_verbose )
116
119
write_msg (NULL , "reading user-defined tables\n" );
117
- tblinfo = getTables (fout , & numTables );
120
+ tblinfo = getTables (fout , dopt , & numTables );
118
121
tblinfoindex = buildIndexArray (tblinfo , numTables , sizeof (TableInfo ));
119
122
120
123
/* Do this after we've built tblinfoindex */
121
124
getOwnedSeqs (fout , tblinfo , numTables );
122
125
123
126
if (g_verbose )
124
127
write_msg (NULL , "reading extensions\n" );
125
- extinfo = getExtensions (fout , & numExtensions );
128
+ extinfo = getExtensions (fout , dopt , & numExtensions );
126
129
127
130
if (g_verbose )
128
131
write_msg (NULL , "reading user-defined functions\n" );
129
- funinfo = getFuncs (fout , & numFuncs );
132
+ funinfo = getFuncs (fout , dopt , & numFuncs );
130
133
funinfoindex = buildIndexArray (funinfo , numFuncs , sizeof (FuncInfo ));
131
134
132
135
/* this must be after getTables and getFuncs */
@@ -142,7 +145,7 @@ getSchemaData(Archive *fout, int *numTablesPtr)
142
145
143
146
if (g_verbose )
144
147
write_msg (NULL , "reading user-defined aggregate functions\n" );
145
- getAggregates (fout , & numAggregates );
148
+ getAggregates (fout , dopt , & numAggregates );
146
149
147
150
if (g_verbose )
148
151
write_msg (NULL , "reading user-defined operators\n" );
@@ -183,7 +186,7 @@ getSchemaData(Archive *fout, int *numTablesPtr)
183
186
184
187
if (g_verbose )
185
188
write_msg (NULL , "reading default privileges\n" );
186
- getDefaultACLs (fout , & numDefaultACLs );
189
+ getDefaultACLs (fout , dopt , & numDefaultACLs );
187
190
188
191
if (g_verbose )
189
192
write_msg (NULL , "reading user-defined collations\n" );
@@ -213,7 +216,7 @@ getSchemaData(Archive *fout, int *numTablesPtr)
213
216
*/
214
217
if (g_verbose )
215
218
write_msg (NULL , "finding extension members\n" );
216
- getExtensionMembership (fout , extinfo , numExtensions );
219
+ getExtensionMembership (fout , dopt , extinfo , numExtensions );
217
220
218
221
/* Link tables to parents, mark parents of target tables interesting */
219
222
if (g_verbose )
@@ -222,11 +225,11 @@ getSchemaData(Archive *fout, int *numTablesPtr)
222
225
223
226
if (g_verbose )
224
227
write_msg (NULL , "reading column info for interesting tables\n" );
225
- getTableAttrs (fout , tblinfo , numTables );
228
+ getTableAttrs (fout , dopt , tblinfo , numTables );
226
229
227
230
if (g_verbose )
228
231
write_msg (NULL , "flagging inherited columns in subtables\n" );
229
- flagInhAttrs (tblinfo , numTables );
232
+ flagInhAttrs (dopt , tblinfo , numTables );
230
233
231
234
if (g_verbose )
232
235
write_msg (NULL , "reading indexes\n" );
@@ -307,7 +310,7 @@ flagInhTables(TableInfo *tblinfo, int numTables,
307
310
* modifies tblinfo
308
311
*/
309
312
static void
310
- flagInhAttrs (TableInfo * tblinfo , int numTables )
313
+ flagInhAttrs (DumpOptions * dopt , TableInfo * tblinfo , int numTables )
311
314
{
312
315
int i ,
313
316
j ,
@@ -384,7 +387,7 @@ flagInhAttrs(TableInfo *tblinfo, int numTables)
384
387
attrDef -> adef_expr = pg_strdup ("NULL" );
385
388
386
389
/* Will column be dumped explicitly? */
387
- if (shouldPrintColumn (tbinfo , j ))
390
+ if (shouldPrintColumn (dopt , tbinfo , j ))
388
391
{
389
392
attrDef -> separate = false;
390
393
/* No dependency needed: NULL cannot have dependencies */
0 commit comments