Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions src/bin/pg_dump/pg_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,13 @@ static int extra_float_digits;
*/
#define DUMP_DEFAULT_ROWS_PER_INSERT 1

/*
* FIXME: CBDB should not know the am oid of PAX. We put here because the kernel
* can't distinguish the PAX and renamed heap(heap_psql) in test `psql`.
* The definition of temporary is here and should be consistent with util/rel.h
*/
#define PAX_AM_OID 7047

/*
* Macro for producing quoted, schema-qualified name of a dumpable object.
*/
Expand Down Expand Up @@ -2098,6 +2105,16 @@ selectDumpableTable(TableInfo *tbinfo, Archive *fout)
simple_oid_list_member(&table_exclude_oids,
tbinfo->dobj.catId.oid))
tbinfo->dobj.dump = DUMP_COMPONENT_NONE;

/*
* Pax not support pg_dump yet
*/
if (tbinfo->amoid == PAX_AM_OID) {
tbinfo->dobj.dump = DUMP_COMPONENT_NONE;

pg_log_warning("unsupport am pax yet, current relation \"%s\" will be ignore",
tbinfo->dobj.name);
}
}

/*
Expand Down Expand Up @@ -7387,6 +7404,7 @@ getTables(Archive *fout, int *numTables)
int i_ispartition;
int i_partbound;
int i_amname;
int i_amoid;
int i_isivm;

/*
Expand Down Expand Up @@ -7479,6 +7497,7 @@ getTables(Archive *fout, int *numTables)
"tc.relminmxid AS tminmxid, "
"c.relpersistence, c.relispopulated, "
"c.relreplident, c.relpages, am.amname, "
"am.oid AS amoid, "
"CASE WHEN c.relkind = 'f' THEN "
"(SELECT ftserver FROM pg_catalog.pg_foreign_table WHERE ftrelid = c.oid) "
"ELSE 0 END AS foreignserver, "
Expand Down Expand Up @@ -8076,6 +8095,7 @@ getTables(Archive *fout, int *numTables)
i_ispartition = PQfnumber(res, "ispartition");
i_partbound = PQfnumber(res, "partbound");
i_amname = PQfnumber(res, "amname");
i_amoid = PQfnumber(res, "amoid");
i_isivm = PQfnumber(res, "isivm");

if (dopt->lockWaitTimeout)
Expand Down Expand Up @@ -8167,6 +8187,11 @@ getTables(Archive *fout, int *numTables)
else
tblinfo[i].amname = pg_strdup(PQgetvalue(res, i, i_amname));

if (PQgetisnull(res, i, i_amoid))
tblinfo[i].amoid = InvalidOid;
else
tblinfo[i].amoid = atooid(PQgetvalue(res, i, i_amoid));

/* other fields were zeroed above */

/*
Expand Down
1 change: 1 addition & 0 deletions src/bin/pg_dump/pg_dump.h
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ typedef struct _tableInfo
char *partbound; /* partition bound definition */
bool needs_override; /* has GENERATED ALWAYS AS IDENTITY */
char *amname; /* relation access method */
Oid amoid; /* relation access method oid */

/*
* Stuff computed only for dumpable tables.
Expand Down