]> granicus.if.org Git - postgresql/commitdiff
Rename pg_dump.c TypeInfo variable tinfo to tyinfo, for clarity.
authorBruce Momjian <bruce@momjian.us>
Wed, 23 Dec 2009 04:10:50 +0000 (04:10 +0000)
committerBruce Momjian <bruce@momjian.us>
Wed, 23 Dec 2009 04:10:50 +0000 (04:10 +0000)
src/bin/pg_dump/pg_dump.c

index 6d6ac1fafe6f54fae008df245513d7180d66ab91..8072d2df5e4e463ac5f166f2f3f3822a27ec37c2 100644 (file)
@@ -12,7 +12,7 @@
  *     by PostgreSQL
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.559 2009/12/22 23:27:41 petere Exp $
+ *       $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.560 2009/12/23 04:10:50 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -131,12 +131,12 @@ static int findComments(Archive *fout, Oid classoid, Oid objoid,
 static int     collectComments(Archive *fout, CommentItem **items);
 static void dumpDumpableObject(Archive *fout, DumpableObject *dobj);
 static void dumpNamespace(Archive *fout, NamespaceInfo *nspinfo);
-static void dumpType(Archive *fout, TypeInfo *tinfo);
-static void dumpBaseType(Archive *fout, TypeInfo *tinfo);
-static void dumpEnumType(Archive *fout, TypeInfo *tinfo);
-static void dumpDomain(Archive *fout, TypeInfo *tinfo);
-static void dumpCompositeType(Archive *fout, TypeInfo *tinfo);
-static void dumpCompositeTypeColComments(Archive *fout, TypeInfo *tinfo);
+static void dumpType(Archive *fout, TypeInfo *tyinfo);
+static void dumpBaseType(Archive *fout, TypeInfo *tyinfo);
+static void dumpEnumType(Archive *fout, TypeInfo *tyinfo);
+static void dumpDomain(Archive *fout, TypeInfo *tyinfo);
+static void dumpCompositeType(Archive *fout, TypeInfo *tyinfo);
+static void dumpCompositeTypeColComments(Archive *fout, TypeInfo *tyinfo);
 static void dumpShellType(Archive *fout, ShellTypeInfo *stinfo);
 static void dumpProcLang(Archive *fout, ProcLangInfo *plang);
 static void dumpFunc(Archive *fout, FuncInfo *finfo);
@@ -172,7 +172,7 @@ static void dumpACL(Archive *fout, CatalogId objCatId, DumpId objDumpId,
                const char *acls);
 
 static void getDependencies(void);
-static void getDomainConstraints(TypeInfo *tinfo);
+static void getDomainConstraints(TypeInfo *tyinfo);
 static void getTableData(TableInfo *tblinfo, int numTables, bool oids);
 static void getTableDataFKConstraints(void);
 static char *format_function_arguments(FuncInfo *finfo, char *funcargs);
@@ -1023,33 +1023,33 @@ selectDumpableTable(TableInfo *tbinfo)
  * first to ensure the objType change is applied regardless of namespace etc.
  */
 static void
-selectDumpableType(TypeInfo *tinfo)
+selectDumpableType(TypeInfo *tyinfo)
 {
        /* skip complex types, except for standalone composite types */
-       if (OidIsValid(tinfo->typrelid) &&
-               tinfo->typrelkind != RELKIND_COMPOSITE_TYPE)
+       if (OidIsValid(tyinfo->typrelid) &&
+               tyinfo->typrelkind != RELKIND_COMPOSITE_TYPE)
        {
-               tinfo->dobj.dump = false;
-               tinfo->dobj.objType = DO_DUMMY_TYPE;
+               tyinfo->dobj.dump = false;
+               tyinfo->dobj.objType = DO_DUMMY_TYPE;
        }
 
        /* skip auto-generated array types */
-       else if (tinfo->isArray)
+       else if (tyinfo->isArray)
        {
-               tinfo->dobj.dump = false;
-               tinfo->dobj.objType = DO_DUMMY_TYPE;
+               tyinfo->dobj.dump = false;
+               tyinfo->dobj.objType = DO_DUMMY_TYPE;
        }
 
        /* dump only types in dumpable namespaces */
-       else if (!tinfo->dobj.namespace->dobj.dump)
-               tinfo->dobj.dump = false;
+       else if (!tyinfo->dobj.namespace->dobj.dump)
+               tyinfo->dobj.dump = false;
 
        /* skip undefined placeholder types */
-       else if (!tinfo->isDefined)
-               tinfo->dobj.dump = false;
+       else if (!tyinfo->isDefined)
+               tyinfo->dobj.dump = false;
 
        else
-               tinfo->dobj.dump = true;
+               tyinfo->dobj.dump = true;
 }
 
 /*
@@ -2340,7 +2340,7 @@ getTypes(int *numTypes)
        int                     ntups;
        int                     i;
        PQExpBuffer query = createPQExpBuffer();
-       TypeInfo   *tinfo;
+       TypeInfo   *tyinfo;
        ShellTypeInfo *stinfo;
        int                     i_tableoid;
        int                     i_oid;
@@ -2440,7 +2440,7 @@ getTypes(int *numTypes)
 
        ntups = PQntuples(res);
 
-       tinfo = (TypeInfo *) malloc(ntups * sizeof(TypeInfo));
+       tyinfo = (TypeInfo *) malloc(ntups * sizeof(TypeInfo));
 
        i_tableoid = PQfnumber(res, "tableoid");
        i_oid = PQfnumber(res, "oid");
@@ -2458,40 +2458,40 @@ getTypes(int *numTypes)
 
        for (i = 0; i < ntups; i++)
        {
-               tinfo[i].dobj.objType = DO_TYPE;
-               tinfo[i].dobj.catId.tableoid = atooid(PQgetvalue(res, i, i_tableoid));
-               tinfo[i].dobj.catId.oid = atooid(PQgetvalue(res, i, i_oid));
-               AssignDumpId(&tinfo[i].dobj);
-               tinfo[i].dobj.name = strdup(PQgetvalue(res, i, i_typname));
-               tinfo[i].dobj.namespace = findNamespace(atooid(PQgetvalue(res, i, i_typnamespace)),
-                                                                                               tinfo[i].dobj.catId.oid);
-               tinfo[i].rolname = strdup(PQgetvalue(res, i, i_rolname));
-               tinfo[i].typelem = atooid(PQgetvalue(res, i, i_typelem));
-               tinfo[i].typrelid = atooid(PQgetvalue(res, i, i_typrelid));
-               tinfo[i].typrelkind = *PQgetvalue(res, i, i_typrelkind);
-               tinfo[i].typtype = *PQgetvalue(res, i, i_typtype);
-               tinfo[i].shellType = NULL;
+               tyinfo[i].dobj.objType = DO_TYPE;
+               tyinfo[i].dobj.catId.tableoid = atooid(PQgetvalue(res, i, i_tableoid));
+               tyinfo[i].dobj.catId.oid = atooid(PQgetvalue(res, i, i_oid));
+               AssignDumpId(&tyinfo[i].dobj);
+               tyinfo[i].dobj.name = strdup(PQgetvalue(res, i, i_typname));
+               tyinfo[i].dobj.namespace = findNamespace(atooid(PQgetvalue(res, i, i_typnamespace)),
+                                                                                               tyinfo[i].dobj.catId.oid);
+               tyinfo[i].rolname = strdup(PQgetvalue(res, i, i_rolname));
+               tyinfo[i].typelem = atooid(PQgetvalue(res, i, i_typelem));
+               tyinfo[i].typrelid = atooid(PQgetvalue(res, i, i_typrelid));
+               tyinfo[i].typrelkind = *PQgetvalue(res, i, i_typrelkind);
+               tyinfo[i].typtype = *PQgetvalue(res, i, i_typtype);
+               tyinfo[i].shellType = NULL;
 
                if (strcmp(PQgetvalue(res, i, i_typisdefined), "t") == 0)
-                       tinfo[i].isDefined = true;
+                       tyinfo[i].isDefined = true;
                else
-                       tinfo[i].isDefined = false;
+                       tyinfo[i].isDefined = false;
 
                if (strcmp(PQgetvalue(res, i, i_isarray), "t") == 0)
-                       tinfo[i].isArray = true;
+                       tyinfo[i].isArray = true;
                else
-                       tinfo[i].isArray = false;
+                       tyinfo[i].isArray = false;
 
                /* Decide whether we want to dump it */
-               selectDumpableType(&tinfo[i]);
+               selectDumpableType(&tyinfo[i]);
 
                /*
                 * If it's a domain, fetch info about its constraints, if any
                 */
-               tinfo[i].nDomChecks = 0;
-               tinfo[i].domChecks = NULL;
-               if (tinfo[i].dobj.dump && tinfo[i].typtype == TYPTYPE_DOMAIN)
-                       getDomainConstraints(&(tinfo[i]));
+               tyinfo[i].nDomChecks = 0;
+               tyinfo[i].domChecks = NULL;
+               if (tyinfo[i].dobj.dump && tyinfo[i].typtype == TYPTYPE_DOMAIN)
+                       getDomainConstraints(&(tyinfo[i]));
 
                /*
                 * If it's a base type, make a DumpableObject representing a shell
@@ -2502,16 +2502,16 @@ getTypes(int *numTypes)
                 * should copy the base type's catId, but then it might capture the
                 * pg_depend entries for the type, which we don't want.
                 */
-               if (tinfo[i].dobj.dump && tinfo[i].typtype == TYPTYPE_BASE)
+               if (tyinfo[i].dobj.dump && tyinfo[i].typtype == TYPTYPE_BASE)
                {
                        stinfo = (ShellTypeInfo *) malloc(sizeof(ShellTypeInfo));
                        stinfo->dobj.objType = DO_SHELL_TYPE;
                        stinfo->dobj.catId = nilCatalogId;
                        AssignDumpId(&stinfo->dobj);
-                       stinfo->dobj.name = strdup(tinfo[i].dobj.name);
-                       stinfo->dobj.namespace = tinfo[i].dobj.namespace;
-                       stinfo->baseType = &(tinfo[i]);
-                       tinfo[i].shellType = stinfo;
+                       stinfo->dobj.name = strdup(tyinfo[i].dobj.name);
+                       stinfo->dobj.namespace = tyinfo[i].dobj.namespace;
+                       stinfo->baseType = &(tyinfo[i]);
+                       tyinfo[i].shellType = stinfo;
 
                        /*
                         * Initially mark the shell type as not to be dumped.  We'll only
@@ -2539,7 +2539,7 @@ getTypes(int *numTypes)
                                if (funcInfo && funcInfo->dobj.dump)
                                {
                                        /* base type depends on function */
-                                       addObjectDependency(&tinfo[i].dobj,
+                                       addObjectDependency(&tyinfo[i].dobj,
                                                                                funcInfo->dobj.dumpId);
                                        /* function depends on shell type */
                                        addObjectDependency(&funcInfo->dobj,
@@ -2552,7 +2552,7 @@ getTypes(int *numTypes)
                                if (funcInfo && funcInfo->dobj.dump)
                                {
                                        /* base type depends on function */
-                                       addObjectDependency(&tinfo[i].dobj,
+                                       addObjectDependency(&tyinfo[i].dobj,
                                                                                funcInfo->dobj.dumpId);
                                        /* function depends on shell type */
                                        addObjectDependency(&funcInfo->dobj,
@@ -2563,9 +2563,9 @@ getTypes(int *numTypes)
                        }
                }
 
-               if (strlen(tinfo[i].rolname) == 0 && tinfo[i].isDefined)
+               if (strlen(tyinfo[i].rolname) == 0 && tyinfo[i].isDefined)
                        write_msg(NULL, "WARNING: owner of data type \"%s\" appears to be invalid\n",
-                                         tinfo[i].dobj.name);
+                                         tyinfo[i].dobj.name);
        }
 
        *numTypes = ntups;
@@ -2574,7 +2574,7 @@ getTypes(int *numTypes)
 
        destroyPQExpBuffer(query);
 
-       return tinfo;
+       return tyinfo;
 }
 
 /*
@@ -4119,7 +4119,7 @@ getConstraints(TableInfo tblinfo[], int numTables)
  * Get info about constraints on a domain.
  */
 static void
-getDomainConstraints(TypeInfo *tinfo)
+getDomainConstraints(TypeInfo *tyinfo)
 {
        int                     i;
        ConstraintInfo *constrinfo;
@@ -4139,7 +4139,7 @@ getDomainConstraints(TypeInfo *tinfo)
         * select appropriate schema to ensure names in constraint are properly
         * qualified
         */
-       selectSourceSchema(tinfo->dobj.namespace->dobj.name);
+       selectSourceSchema(tyinfo->dobj.namespace->dobj.name);
 
        query = createPQExpBuffer();
 
@@ -4149,14 +4149,14 @@ getDomainConstraints(TypeInfo *tinfo)
                                                  "FROM pg_catalog.pg_constraint "
                                                  "WHERE contypid = '%u'::pg_catalog.oid "
                                                  "ORDER BY conname",
-                                                 tinfo->dobj.catId.oid);
+                                                 tyinfo->dobj.catId.oid);
        else
                appendPQExpBuffer(query, "SELECT tableoid, oid, conname, "
                                                  "'CHECK (' || consrc || ')' AS consrc "
                                                  "FROM pg_catalog.pg_constraint "
                                                  "WHERE contypid = '%u'::pg_catalog.oid "
                                                  "ORDER BY conname",
-                                                 tinfo->dobj.catId.oid);
+                                                 tyinfo->dobj.catId.oid);
 
        res = PQexec(g_conn, query->data);
        check_sql_result(res, g_conn, query->data, PGRES_TUPLES_OK);
@@ -4170,8 +4170,8 @@ getDomainConstraints(TypeInfo *tinfo)
 
        constrinfo = (ConstraintInfo *) malloc(ntups * sizeof(ConstraintInfo));
 
-       tinfo->nDomChecks = ntups;
-       tinfo->domChecks = constrinfo;
+       tyinfo->nDomChecks = ntups;
+       tyinfo->domChecks = constrinfo;
 
        for (i = 0; i < ntups; i++)
        {
@@ -4180,9 +4180,9 @@ getDomainConstraints(TypeInfo *tinfo)
                constrinfo[i].dobj.catId.oid = atooid(PQgetvalue(res, i, i_oid));
                AssignDumpId(&constrinfo[i].dobj);
                constrinfo[i].dobj.name = strdup(PQgetvalue(res, i, i_conname));
-               constrinfo[i].dobj.namespace = tinfo->dobj.namespace;
+               constrinfo[i].dobj.namespace = tyinfo->dobj.namespace;
                constrinfo[i].contable = NULL;
-               constrinfo[i].condomain = tinfo;
+               constrinfo[i].condomain = tyinfo;
                constrinfo[i].contype = 'c';
                constrinfo[i].condef = strdup(PQgetvalue(res, i, i_consrc));
                constrinfo[i].confrelid = InvalidOid;
@@ -4196,7 +4196,7 @@ getDomainConstraints(TypeInfo *tinfo)
                 * Make the domain depend on the constraint, ensuring it won't be
                 * output till any constraint dependencies are OK.
                 */
-               addObjectDependency(&tinfo->dobj,
+               addObjectDependency(&tyinfo->dobj,
                                                        constrinfo[i].dobj.dumpId);
        }
 
@@ -6368,21 +6368,21 @@ dumpNamespace(Archive *fout, NamespaceInfo *nspinfo)
  *       writes out to fout the queries to recreate a user-defined type
  */
 static void
-dumpType(Archive *fout, TypeInfo *tinfo)
+dumpType(Archive *fout, TypeInfo *tyinfo)
 {
        /* Skip if not to be dumped */
-       if (!tinfo->dobj.dump || dataOnly)
+       if (!tyinfo->dobj.dump || dataOnly)
                return;
 
        /* Dump out in proper style */
-       if (tinfo->typtype == TYPTYPE_BASE)
-               dumpBaseType(fout, tinfo);
-       else if (tinfo->typtype == TYPTYPE_DOMAIN)
-               dumpDomain(fout, tinfo);
-       else if (tinfo->typtype == TYPTYPE_COMPOSITE)
-               dumpCompositeType(fout, tinfo);
-       else if (tinfo->typtype == TYPTYPE_ENUM)
-               dumpEnumType(fout, tinfo);
+       if (tyinfo->typtype == TYPTYPE_BASE)
+               dumpBaseType(fout, tyinfo);
+       else if (tyinfo->typtype == TYPTYPE_DOMAIN)
+               dumpDomain(fout, tyinfo);
+       else if (tyinfo->typtype == TYPTYPE_COMPOSITE)
+               dumpCompositeType(fout, tyinfo);
+       else if (tyinfo->typtype == TYPTYPE_ENUM)
+               dumpEnumType(fout, tyinfo);
 }
 
 /*
@@ -6390,7 +6390,7 @@ dumpType(Archive *fout, TypeInfo *tinfo)
  *       writes out to fout the queries to recreate a user-defined enum type
  */
 static void
-dumpEnumType(Archive *fout, TypeInfo *tinfo)
+dumpEnumType(Archive *fout, TypeInfo *tyinfo)
 {
        PQExpBuffer q = createPQExpBuffer();
        PQExpBuffer delq = createPQExpBuffer();
@@ -6401,12 +6401,12 @@ dumpEnumType(Archive *fout, TypeInfo *tinfo)
        char       *label;
 
        /* Set proper schema search path so regproc references list correctly */
-       selectSourceSchema(tinfo->dobj.namespace->dobj.name);
+       selectSourceSchema(tyinfo->dobj.namespace->dobj.name);
 
        appendPQExpBuffer(query, "SELECT enumlabel FROM pg_catalog.pg_enum "
                                          "WHERE enumtypid = '%u'"
                                          "ORDER BY oid",
-                                         tinfo->dobj.catId.oid);
+                                         tyinfo->dobj.catId.oid);
 
        res = PQexec(g_conn, query->data);
        check_sql_result(res, g_conn, query->data, PGRES_TUPLES_OK);
@@ -6415,7 +6415,7 @@ dumpEnumType(Archive *fout, TypeInfo *tinfo)
        /* should be at least 1 value */
        if (num == 0)
        {
-               write_msg(NULL, "no label definitions found for enum ID %u\n", tinfo->dobj.catId.oid);
+               write_msg(NULL, "no label definitions found for enum ID %u\n", tyinfo->dobj.catId.oid);
                exit_nicely();
        }
 
@@ -6425,11 +6425,11 @@ dumpEnumType(Archive *fout, TypeInfo *tinfo)
         * functions are generic and do not get dropped.
         */
        appendPQExpBuffer(delq, "DROP TYPE %s.",
-                                         fmtId(tinfo->dobj.namespace->dobj.name));
+                                         fmtId(tyinfo->dobj.namespace->dobj.name));
        appendPQExpBuffer(delq, "%s;\n",
-                                         fmtId(tinfo->dobj.name));
+                                         fmtId(tyinfo->dobj.name));
        appendPQExpBuffer(q, "CREATE TYPE %s AS ENUM (\n",
-                                         fmtId(tinfo->dobj.name));
+                                         fmtId(tyinfo->dobj.name));
        for (i = 0; i < num; i++)
        {
                label = PQgetvalue(res, i, 0);
@@ -6440,23 +6440,23 @@ dumpEnumType(Archive *fout, TypeInfo *tinfo)
        }
        appendPQExpBuffer(q, "\n);\n");
 
-       ArchiveEntry(fout, tinfo->dobj.catId, tinfo->dobj.dumpId,
-                                tinfo->dobj.name,
-                                tinfo->dobj.namespace->dobj.name,
+       ArchiveEntry(fout, tyinfo->dobj.catId, tyinfo->dobj.dumpId,
+                                tyinfo->dobj.name,
+                                tyinfo->dobj.namespace->dobj.name,
                                 NULL,
-                                tinfo->rolname, false,
+                                tyinfo->rolname, false,
                                 "TYPE", SECTION_PRE_DATA,
                                 q->data, delq->data, NULL,
-                                tinfo->dobj.dependencies, tinfo->dobj.nDeps,
+                                tyinfo->dobj.dependencies, tyinfo->dobj.nDeps,
                                 NULL, NULL);
 
        /* Dump Type Comments */
        resetPQExpBuffer(q);
 
-       appendPQExpBuffer(q, "TYPE %s", fmtId(tinfo->dobj.name));
+       appendPQExpBuffer(q, "TYPE %s", fmtId(tyinfo->dobj.name));
        dumpComment(fout, q->data,
-                               tinfo->dobj.namespace->dobj.name, tinfo->rolname,
-                               tinfo->dobj.catId, 0, tinfo->dobj.dumpId);
+                               tyinfo->dobj.namespace->dobj.name, tyinfo->rolname,
+                               tyinfo->dobj.catId, 0, tyinfo->dobj.dumpId);
 
        PQclear(res);
        destroyPQExpBuffer(q);
@@ -6469,7 +6469,7 @@ dumpEnumType(Archive *fout, TypeInfo *tinfo)
  *       writes out to fout the queries to recreate a user-defined base type
  */
 static void
-dumpBaseType(Archive *fout, TypeInfo *tinfo)
+dumpBaseType(Archive *fout, TypeInfo *tyinfo)
 {
        PQExpBuffer q = createPQExpBuffer();
        PQExpBuffer delq = createPQExpBuffer();
@@ -6501,7 +6501,7 @@ dumpBaseType(Archive *fout, TypeInfo *tinfo)
        bool            typdefault_is_literal = false;
 
        /* Set proper schema search path so regproc references list correctly */
-       selectSourceSchema(tinfo->dobj.namespace->dobj.name);
+       selectSourceSchema(tyinfo->dobj.namespace->dobj.name);
 
        /* Fetch type-specific details */
        if (fout->remoteVersion >= 80400)
@@ -6521,7 +6521,7 @@ dumpBaseType(Archive *fout, TypeInfo *tinfo)
                                                  "pg_catalog.pg_get_expr(typdefaultbin, 0) AS typdefaultbin, typdefault "
                                                  "FROM pg_catalog.pg_type "
                                                  "WHERE oid = '%u'::pg_catalog.oid",
-                                                 tinfo->dobj.catId.oid);
+                                                 tyinfo->dobj.catId.oid);
        }
        else if (fout->remoteVersion >= 80300)
        {
@@ -6541,7 +6541,7 @@ dumpBaseType(Archive *fout, TypeInfo *tinfo)
                                                  "pg_catalog.pg_get_expr(typdefaultbin, 'pg_catalog.pg_type'::pg_catalog.regclass) AS typdefaultbin, typdefault "
                                                  "FROM pg_catalog.pg_type "
                                                  "WHERE oid = '%u'::pg_catalog.oid",
-                                                 tinfo->dobj.catId.oid);
+                                                 tyinfo->dobj.catId.oid);
        }
        else if (fout->remoteVersion >= 80000)
        {
@@ -6560,7 +6560,7 @@ dumpBaseType(Archive *fout, TypeInfo *tinfo)
                                                  "pg_catalog.pg_get_expr(typdefaultbin, 'pg_catalog.pg_type'::pg_catalog.regclass) AS typdefaultbin, typdefault "
                                                  "FROM pg_catalog.pg_type "
                                                  "WHERE oid = '%u'::pg_catalog.oid",
-                                                 tinfo->dobj.catId.oid);
+                                                 tyinfo->dobj.catId.oid);
        }
        else if (fout->remoteVersion >= 70400)
        {
@@ -6579,7 +6579,7 @@ dumpBaseType(Archive *fout, TypeInfo *tinfo)
                                                  "pg_catalog.pg_get_expr(typdefaultbin, 'pg_catalog.pg_type'::pg_catalog.regclass) AS typdefaultbin, typdefault "
                                                  "FROM pg_catalog.pg_type "
                                                  "WHERE oid = '%u'::pg_catalog.oid",
-                                                 tinfo->dobj.catId.oid);
+                                                 tyinfo->dobj.catId.oid);
        }
        else if (fout->remoteVersion >= 70300)
        {
@@ -6598,7 +6598,7 @@ dumpBaseType(Archive *fout, TypeInfo *tinfo)
                                                  "pg_catalog.pg_get_expr(typdefaultbin, 'pg_catalog.pg_type'::pg_catalog.regclass) AS typdefaultbin, typdefault "
                                                  "FROM pg_catalog.pg_type "
                                                  "WHERE oid = '%u'::pg_catalog.oid",
-                                                 tinfo->dobj.catId.oid);
+                                                 tyinfo->dobj.catId.oid);
        }
        else if (fout->remoteVersion >= 70200)
        {
@@ -6621,7 +6621,7 @@ dumpBaseType(Archive *fout, TypeInfo *tinfo)
                                                  "NULL AS typdefaultbin, typdefault "
                                                  "FROM pg_type "
                                                  "WHERE oid = '%u'::oid",
-                                                 tinfo->dobj.catId.oid);
+                                                 tyinfo->dobj.catId.oid);
        }
        else if (fout->remoteVersion >= 70100)
        {
@@ -6644,7 +6644,7 @@ dumpBaseType(Archive *fout, TypeInfo *tinfo)
                                                  "NULL AS typdefaultbin, NULL AS typdefault "
                                                  "FROM pg_type "
                                                  "WHERE oid = '%u'::oid",
-                                                 tinfo->dobj.catId.oid);
+                                                 tyinfo->dobj.catId.oid);
        }
        else
        {
@@ -6664,7 +6664,7 @@ dumpBaseType(Archive *fout, TypeInfo *tinfo)
                                                  "NULL AS typdefaultbin, NULL AS typdefault "
                                                  "FROM pg_type "
                                                  "WHERE oid = '%u'::oid",
-                                                 tinfo->dobj.catId.oid);
+                                                 tyinfo->dobj.catId.oid);
        }
 
        res = PQexec(g_conn, query->data);
@@ -6719,14 +6719,14 @@ dumpBaseType(Archive *fout, TypeInfo *tinfo)
         * other way.
         */
        appendPQExpBuffer(delq, "DROP TYPE %s.",
-                                         fmtId(tinfo->dobj.namespace->dobj.name));
+                                         fmtId(tyinfo->dobj.namespace->dobj.name));
        appendPQExpBuffer(delq, "%s CASCADE;\n",
-                                         fmtId(tinfo->dobj.name));
+                                         fmtId(tyinfo->dobj.name));
 
        appendPQExpBuffer(q,
                                          "CREATE TYPE %s (\n"
                                          "    INTERNALLENGTH = %s",
-                                         fmtId(tinfo->dobj.name),
+                                         fmtId(tyinfo->dobj.name),
                                          (strcmp(typlen, "-1") == 0) ? "variable" : typlen);
 
        if (fout->remoteVersion >= 70300)
@@ -6763,13 +6763,13 @@ dumpBaseType(Archive *fout, TypeInfo *tinfo)
                        appendPQExpBufferStr(q, typdefault);
        }
 
-       if (OidIsValid(tinfo->typelem))
+       if (OidIsValid(tyinfo->typelem))
        {
                char       *elemType;
 
                /* reselect schema in case changed by function dump */
-               selectSourceSchema(tinfo->dobj.namespace->dobj.name);
-               elemType = getFormattedTypeName(tinfo->typelem, zeroAsOpaque);
+               selectSourceSchema(tyinfo->dobj.namespace->dobj.name);
+               elemType = getFormattedTypeName(tyinfo->typelem, zeroAsOpaque);
                appendPQExpBuffer(q, ",\n    ELEMENT = %s", elemType);
                free(elemType);
        }
@@ -6812,23 +6812,23 @@ dumpBaseType(Archive *fout, TypeInfo *tinfo)
 
        appendPQExpBuffer(q, "\n);\n");
 
-       ArchiveEntry(fout, tinfo->dobj.catId, tinfo->dobj.dumpId,
-                                tinfo->dobj.name,
-                                tinfo->dobj.namespace->dobj.name,
+       ArchiveEntry(fout, tyinfo->dobj.catId, tyinfo->dobj.dumpId,
+                                tyinfo->dobj.name,
+                                tyinfo->dobj.namespace->dobj.name,
                                 NULL,
-                                tinfo->rolname, false,
+                                tyinfo->rolname, false,
                                 "TYPE", SECTION_PRE_DATA,
                                 q->data, delq->data, NULL,
-                                tinfo->dobj.dependencies, tinfo->dobj.nDeps,
+                                tyinfo->dobj.dependencies, tyinfo->dobj.nDeps,
                                 NULL, NULL);
 
        /* Dump Type Comments */
        resetPQExpBuffer(q);
 
-       appendPQExpBuffer(q, "TYPE %s", fmtId(tinfo->dobj.name));
+       appendPQExpBuffer(q, "TYPE %s", fmtId(tyinfo->dobj.name));
        dumpComment(fout, q->data,
-                               tinfo->dobj.namespace->dobj.name, tinfo->rolname,
-                               tinfo->dobj.catId, 0, tinfo->dobj.dumpId);
+                               tyinfo->dobj.namespace->dobj.name, tyinfo->rolname,
+                               tyinfo->dobj.catId, 0, tyinfo->dobj.dumpId);
 
        PQclear(res);
        destroyPQExpBuffer(q);
@@ -6841,7 +6841,7 @@ dumpBaseType(Archive *fout, TypeInfo *tinfo)
  *       writes out to fout the queries to recreate a user-defined domain
  */
 static void
-dumpDomain(Archive *fout, TypeInfo *tinfo)
+dumpDomain(Archive *fout, TypeInfo *tyinfo)
 {
        PQExpBuffer q = createPQExpBuffer();
        PQExpBuffer delq = createPQExpBuffer();
@@ -6855,7 +6855,7 @@ dumpDomain(Archive *fout, TypeInfo *tinfo)
        bool            typdefault_is_literal = false;
 
        /* Set proper schema search path so type references list correctly */
-       selectSourceSchema(tinfo->dobj.namespace->dobj.name);
+       selectSourceSchema(tyinfo->dobj.namespace->dobj.name);
 
        /* Fetch domain specific details */
        /* We assume here that remoteVersion must be at least 70300 */
@@ -6864,7 +6864,7 @@ dumpDomain(Archive *fout, TypeInfo *tinfo)
                                          "pg_catalog.pg_get_expr(typdefaultbin, 'pg_catalog.pg_type'::pg_catalog.regclass) AS typdefaultbin, typdefault "
                                          "FROM pg_catalog.pg_type "
                                          "WHERE oid = '%u'::pg_catalog.oid",
-                                         tinfo->dobj.catId.oid);
+                                         tyinfo->dobj.catId.oid);
 
        res = PQexec(g_conn, query->data);
        check_sql_result(res, g_conn, query->data, PGRES_TUPLES_OK);
@@ -6894,7 +6894,7 @@ dumpDomain(Archive *fout, TypeInfo *tinfo)
 
        appendPQExpBuffer(q,
                                          "CREATE DOMAIN %s AS %s",
-                                         fmtId(tinfo->dobj.name),
+                                         fmtId(tyinfo->dobj.name),
                                          typdefn);
 
        if (typnotnull[0] == 't')
@@ -6914,9 +6914,9 @@ dumpDomain(Archive *fout, TypeInfo *tinfo)
        /*
         * Add any CHECK constraints for the domain
         */
-       for (i = 0; i < tinfo->nDomChecks; i++)
+       for (i = 0; i < tyinfo->nDomChecks; i++)
        {
-               ConstraintInfo *domcheck = &(tinfo->domChecks[i]);
+               ConstraintInfo *domcheck = &(tyinfo->domChecks[i]);
 
                if (!domcheck->separate)
                        appendPQExpBuffer(q, "\n\tCONSTRAINT %s %s",
@@ -6929,27 +6929,27 @@ dumpDomain(Archive *fout, TypeInfo *tinfo)
         * DROP must be fully qualified in case same name appears in pg_catalog
         */
        appendPQExpBuffer(delq, "DROP DOMAIN %s.",
-                                         fmtId(tinfo->dobj.namespace->dobj.name));
+                                         fmtId(tyinfo->dobj.namespace->dobj.name));
        appendPQExpBuffer(delq, "%s;\n",
-                                         fmtId(tinfo->dobj.name));
+                                         fmtId(tyinfo->dobj.name));
 
-       ArchiveEntry(fout, tinfo->dobj.catId, tinfo->dobj.dumpId,
-                                tinfo->dobj.name,
-                                tinfo->dobj.namespace->dobj.name,
+       ArchiveEntry(fout, tyinfo->dobj.catId, tyinfo->dobj.dumpId,
+                                tyinfo->dobj.name,
+                                tyinfo->dobj.namespace->dobj.name,
                                 NULL,
-                                tinfo->rolname, false,
+                                tyinfo->rolname, false,
                                 "DOMAIN", SECTION_PRE_DATA,
                                 q->data, delq->data, NULL,
-                                tinfo->dobj.dependencies, tinfo->dobj.nDeps,
+                                tyinfo->dobj.dependencies, tyinfo->dobj.nDeps,
                                 NULL, NULL);
 
        /* Dump Domain Comments */
        resetPQExpBuffer(q);
 
-       appendPQExpBuffer(q, "DOMAIN %s", fmtId(tinfo->dobj.name));
+       appendPQExpBuffer(q, "DOMAIN %s", fmtId(tyinfo->dobj.name));
        dumpComment(fout, q->data,
-                               tinfo->dobj.namespace->dobj.name, tinfo->rolname,
-                               tinfo->dobj.catId, 0, tinfo->dobj.dumpId);
+                               tyinfo->dobj.namespace->dobj.name, tyinfo->rolname,
+                               tyinfo->dobj.catId, 0, tyinfo->dobj.dumpId);
 
        destroyPQExpBuffer(q);
        destroyPQExpBuffer(delq);
@@ -6962,7 +6962,7 @@ dumpDomain(Archive *fout, TypeInfo *tinfo)
  *       composite type
  */
 static void
-dumpCompositeType(Archive *fout, TypeInfo *tinfo)
+dumpCompositeType(Archive *fout, TypeInfo *tyinfo)
 {
        PQExpBuffer q = createPQExpBuffer();
        PQExpBuffer delq = createPQExpBuffer();
@@ -6974,7 +6974,7 @@ dumpCompositeType(Archive *fout, TypeInfo *tinfo)
        int                     i;
 
        /* Set proper schema search path so type references list correctly */
-       selectSourceSchema(tinfo->dobj.namespace->dobj.name);
+       selectSourceSchema(tyinfo->dobj.namespace->dobj.name);
 
        /* Fetch type specific details */
        /* We assume here that remoteVersion must be at least 70300 */
@@ -6986,7 +6986,7 @@ dumpCompositeType(Archive *fout, TypeInfo *tinfo)
                                          "AND a.attrelid = t.typrelid "
                                          "AND NOT a.attisdropped "
                                          "ORDER BY a.attnum ",
-                                         tinfo->dobj.catId.oid);
+                                         tyinfo->dobj.catId.oid);
 
        res = PQexec(g_conn, query->data);
        check_sql_result(res, g_conn, query->data, PGRES_TUPLES_OK);
@@ -7003,7 +7003,7 @@ dumpCompositeType(Archive *fout, TypeInfo *tinfo)
        i_atttypdefn = PQfnumber(res, "atttypdefn");
 
        appendPQExpBuffer(q, "CREATE TYPE %s AS (",
-                                         fmtId(tinfo->dobj.name));
+                                         fmtId(tyinfo->dobj.name));
 
        for (i = 0; i < ntups; i++)
        {
@@ -7023,28 +7023,28 @@ dumpCompositeType(Archive *fout, TypeInfo *tinfo)
         * DROP must be fully qualified in case same name appears in pg_catalog
         */
        appendPQExpBuffer(delq, "DROP TYPE %s.",
-                                         fmtId(tinfo->dobj.namespace->dobj.name));
+                                         fmtId(tyinfo->dobj.namespace->dobj.name));
        appendPQExpBuffer(delq, "%s;\n",
-                                         fmtId(tinfo->dobj.name));
+                                         fmtId(tyinfo->dobj.name));
 
-       ArchiveEntry(fout, tinfo->dobj.catId, tinfo->dobj.dumpId,
-                                tinfo->dobj.name,
-                                tinfo->dobj.namespace->dobj.name,
+       ArchiveEntry(fout, tyinfo->dobj.catId, tyinfo->dobj.dumpId,
+                                tyinfo->dobj.name,
+                                tyinfo->dobj.namespace->dobj.name,
                                 NULL,
-                                tinfo->rolname, false,
+                                tyinfo->rolname, false,
                                 "TYPE", SECTION_PRE_DATA,
                                 q->data, delq->data, NULL,
-                                tinfo->dobj.dependencies, tinfo->dobj.nDeps,
+                                tyinfo->dobj.dependencies, tyinfo->dobj.nDeps,
                                 NULL, NULL);
 
 
        /* Dump Type Comments */
        resetPQExpBuffer(q);
 
-       appendPQExpBuffer(q, "TYPE %s", fmtId(tinfo->dobj.name));
+       appendPQExpBuffer(q, "TYPE %s", fmtId(tyinfo->dobj.name));
        dumpComment(fout, q->data,
-                               tinfo->dobj.namespace->dobj.name, tinfo->rolname,
-                               tinfo->dobj.catId, 0, tinfo->dobj.dumpId);
+                               tyinfo->dobj.namespace->dobj.name, tyinfo->rolname,
+                               tyinfo->dobj.catId, 0, tyinfo->dobj.dumpId);
 
        PQclear(res);
        destroyPQExpBuffer(q);
@@ -7052,7 +7052,7 @@ dumpCompositeType(Archive *fout, TypeInfo *tinfo)
        destroyPQExpBuffer(query);
 
        /* Dump any per-column comments */
-       dumpCompositeTypeColComments(fout, tinfo);
+       dumpCompositeTypeColComments(fout, tyinfo);
 }
 
 /*
@@ -7061,7 +7061,7 @@ dumpCompositeType(Archive *fout, TypeInfo *tinfo)
  *       a user-defined stand-alone composite type
  */
 static void
-dumpCompositeTypeColComments(Archive *fout, TypeInfo *tinfo)
+dumpCompositeTypeColComments(Archive *fout, TypeInfo *tyinfo)
 {
        CommentItem *comments;
        int ncomments;
@@ -7083,7 +7083,7 @@ dumpCompositeTypeColComments(Archive *fout, TypeInfo *tinfo)
                                          "WHERE c.oid = '%u' AND c.oid = a.attrelid "
                                          "  AND NOT a.attisdropped "
                                          "ORDER BY a.attnum ",
-                                         tinfo->typrelid);
+                                         tyinfo->typrelid);
 
        /* Fetch column attnames */
        res = PQexec(g_conn, query->data);
@@ -7102,7 +7102,7 @@ dumpCompositeTypeColComments(Archive *fout, TypeInfo *tinfo)
        /* Search for comments associated with type's pg_class OID */
        ncomments = findComments(fout,
                                                         pgClassOid,
-                                                        tinfo->typrelid,
+                                                        tyinfo->typrelid,
                                                         &comments);
 
        /* If no comments exist, we're done */
@@ -7137,7 +7137,7 @@ dumpCompositeTypeColComments(Archive *fout, TypeInfo *tinfo)
 
                        resetPQExpBuffer(target);
                        appendPQExpBuffer(target, "COLUMN %s.",
-                                                         fmtId(tinfo->dobj.name));
+                                                         fmtId(tyinfo->dobj.name));
                        appendPQExpBuffer(target, "%s",
                                                          fmtId(attname));
 
@@ -7148,11 +7148,11 @@ dumpCompositeTypeColComments(Archive *fout, TypeInfo *tinfo)
 
                        ArchiveEntry(fout, nilCatalogId, createDumpId(),
                                                 target->data,
-                                                tinfo->dobj.namespace->dobj.name,
-                                                NULL, tinfo->rolname,
+                                                tyinfo->dobj.namespace->dobj.name,
+                                                NULL, tyinfo->rolname,
                                                 false, "COMMENT", SECTION_NONE,
                                                 query->data, "", NULL,
-                                                &(tinfo->dobj.dumpId), 1,
+                                                &(tyinfo->dobj.dumpId), 1,
                                                 NULL, NULL);
                }
 
@@ -10972,13 +10972,13 @@ dumpConstraint(Archive *fout, ConstraintInfo *coninfo)
        else if (coninfo->contype == 'c' && tbinfo == NULL)
        {
                /* CHECK constraint on a domain */
-               TypeInfo   *tinfo = coninfo->condomain;
+               TypeInfo   *tyinfo = coninfo->condomain;
 
                /* Ignore if not to be dumped separately */
                if (coninfo->separate)
                {
                        appendPQExpBuffer(q, "ALTER DOMAIN %s\n",
-                                                         fmtId(tinfo->dobj.name));
+                                                         fmtId(tyinfo->dobj.name));
                        appendPQExpBuffer(q, "    ADD CONSTRAINT %s %s;\n",
                                                          fmtId(coninfo->dobj.name),
                                                          coninfo->condef);
@@ -10988,17 +10988,17 @@ dumpConstraint(Archive *fout, ConstraintInfo *coninfo)
                         * pg_catalog
                         */
                        appendPQExpBuffer(delq, "ALTER DOMAIN %s.",
-                                                         fmtId(tinfo->dobj.namespace->dobj.name));
+                                                         fmtId(tyinfo->dobj.namespace->dobj.name));
                        appendPQExpBuffer(delq, "%s ",
-                                                         fmtId(tinfo->dobj.name));
+                                                         fmtId(tyinfo->dobj.name));
                        appendPQExpBuffer(delq, "DROP CONSTRAINT %s;\n",
                                                          fmtId(coninfo->dobj.name));
 
                        ArchiveEntry(fout, coninfo->dobj.catId, coninfo->dobj.dumpId,
                                                 coninfo->dobj.name,
-                                                tinfo->dobj.namespace->dobj.name,
+                                                tyinfo->dobj.namespace->dobj.name,
                                                 NULL,
-                                                tinfo->rolname, false,
+                                                tyinfo->rolname, false,
                                                 "CHECK CONSTRAINT", SECTION_POST_DATA,
                                                 q->data, delq->data, NULL,
                                                 coninfo->dobj.dependencies, coninfo->dobj.nDeps,