diff options
Diffstat (limited to 'src/bin/pg_dump/pg_dump.c')
-rw-r--r-- | src/bin/pg_dump/pg_dump.c | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index caa25e3e758..a12c8d011bc 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -82,10 +82,9 @@ typedef struct typedef enum OidOptions { - zeroAsOpaque = 1, - zeroAsAny = 2, - zeroAsStar = 4, - zeroAsNone = 8 + zeroIsError = 1, + zeroAsStar = 2, + zeroAsNone = 4 } OidOptions; /* global decls */ @@ -122,8 +121,6 @@ static SimpleStringList tabledata_exclude_patterns = {NULL, NULL}; static SimpleOidList tabledata_exclude_oids = {NULL, NULL}; -char g_opaque_type[10]; /* name for the opaque type */ - /* placeholders for the delimiters for comments */ char g_comment_start[10]; char g_comment_end[10]; @@ -404,7 +401,6 @@ main(int argc, char **argv) strcpy(g_comment_start, "-- "); g_comment_end[0] = '\0'; - strcpy(g_opaque_type, "opaque"); progname = get_progname(argv[0]); @@ -10736,7 +10732,7 @@ dumpBaseType(Archive *fout, TypeInfo *tyinfo) { char *elemType; - elemType = getFormattedTypeName(fout, tyinfo->typelem, zeroAsOpaque); + elemType = getFormattedTypeName(fout, tyinfo->typelem, zeroIsError); appendPQExpBuffer(q, ",\n ELEMENT = %s", elemType); free(elemType); } @@ -11547,7 +11543,7 @@ format_function_arguments_old(Archive *fout, const char *argname; typid = allargtypes ? atooid(allargtypes[j]) : finfo->argtypes[j]; - typname = getFormattedTypeName(fout, typid, zeroAsOpaque); + typname = getFormattedTypeName(fout, typid, zeroIsError); if (argmodes) { @@ -11616,7 +11612,7 @@ format_function_signature(Archive *fout, FuncInfo *finfo, bool honor_quotes) appendPQExpBufferStr(&fn, ", "); typname = getFormattedTypeName(fout, finfo->argtypes[j], - zeroAsOpaque); + zeroIsError); appendPQExpBufferStr(&fn, typname); free(typname); } @@ -12021,7 +12017,7 @@ dumpFunc(Archive *fout, FuncInfo *finfo) else { rettypename = getFormattedTypeName(fout, finfo->prorettype, - zeroAsOpaque); + zeroIsError); appendPQExpBuffer(q, " RETURNS %s%s", (proretset[0] == 't') ? "SETOF " : "", rettypename); @@ -13740,7 +13736,7 @@ format_aggregate_signature(AggInfo *agginfo, Archive *fout, bool honor_quotes) char *typname; typname = getFormattedTypeName(fout, agginfo->aggfn.argtypes[j], - zeroAsOpaque); + zeroIsError); appendPQExpBuffer(&buf, "%s%s", (j > 0) ? ", " : "", @@ -18363,11 +18359,7 @@ getFormattedTypeName(Archive *fout, Oid oid, OidOptions opts) if (oid == 0) { - if ((opts & zeroAsOpaque) != 0) - return pg_strdup(g_opaque_type); - else if ((opts & zeroAsAny) != 0) - return pg_strdup("'any'"); - else if ((opts & zeroAsStar) != 0) + if ((opts & zeroAsStar) != 0) return pg_strdup("*"); else if ((opts & zeroAsNone) != 0) return pg_strdup("NONE"); |