From 24297040a8209b11eb533baa63cb6f2b4fc7c51a Mon Sep 17 00:00:00 2001 From: "Paul A. Jungwirth" Date: Sat, 21 Sep 2019 21:28:37 -0700 Subject: [PATCH v5 3/4] multirange pg_dump --- src/bin/pg_dump/pg_dump.c | 7 ++++++- src/bin/pg_dump/pg_dump.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index bf69adc2f4..db84e79e11 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -1583,7 +1583,7 @@ selectDumpableType(TypeInfo *tyinfo, Archive *fout) } /* skip auto-generated array types */ - if (tyinfo->isArray) + if (tyinfo->isArray || tyinfo->isMultirange) { tyinfo->dobj.objType = DO_DUMMY_TYPE; @@ -4923,6 +4923,11 @@ getTypes(Archive *fout, int *numTypes) else tyinfo[i].isArray = false; + if (tyinfo[i].typtype == 'm') + tyinfo[i].isMultirange = true; + else + tyinfo[i].isMultirange = false; + /* Decide whether we want to dump it */ selectDumpableType(&tyinfo[i], fout); diff --git a/src/bin/pg_dump/pg_dump.h b/src/bin/pg_dump/pg_dump.h index 7b2c1524a5..e27a752b6d 100644 --- a/src/bin/pg_dump/pg_dump.h +++ b/src/bin/pg_dump/pg_dump.h @@ -175,6 +175,7 @@ typedef struct _typeInfo char typrelkind; /* 'r', 'v', 'c', etc */ char typtype; /* 'b', 'c', etc */ bool isArray; /* true if auto-generated array type */ + bool isMultirange; /* true if auto-generated multirange type */ bool isDefined; /* true if typisdefined */ /* If needed, we'll create a "shell type" entry for it; link that here: */ struct _shellTypeInfo *shellType; /* shell-type entry, or NULL */ -- 2.11.0