From c372b651a8d575cf3c6ed80e4f581ef03373c06a Mon Sep 17 00:00:00 2001 From: "Paul A. Jungwirth" Date: Sat, 21 Sep 2019 21:28:37 -0700 Subject: [PATCH v3 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 f01fea5b91..124ee1a842 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -1586,7 +1586,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; @@ -4926,6 +4926,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 ec5a924b8f..98ba052d5b 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