Suppress compiler warning about potentially uninitialized variable.
authorTom Lane <[email protected]>
Sat, 2 Jul 2011 00:57:34 +0000 (20:57 -0400)
committerTom Lane <[email protected]>
Sat, 2 Jul 2011 00:57:34 +0000 (20:57 -0400)
Maybe some compilers are smart enough to not complain about the previous
coding ... but mine isn't.

src/backend/commands/typecmds.c

index 437d23a8102fdc96d46b834d616636d3665227d3..3f3e0bce34d42dc7391e9f5c238221f482dec0e9 100644 (file)
@@ -2046,7 +2046,7 @@ AlterDomainValidateConstraint(List *names, char *constrName)
    Relation    conrel;
    HeapTuple   tup;
    Form_pg_type typTup;
-   Form_pg_constraint con;
+   Form_pg_constraint con = NULL;
    Form_pg_constraint copy_con;
    char       *conbin;
    SysScanDesc scan;
@@ -2094,13 +2094,10 @@ AlterDomainValidateConstraint(List *names, char *constrName)
    }
 
    if (!found)
-   {
-       con = NULL;     /* keep compiler quiet */
        ereport(ERROR,
                (errcode(ERRCODE_UNDEFINED_OBJECT),
                 errmsg("constraint \"%s\" of domain \"%s\" does not exist",
                        constrName, NameStr(con->conname))));
-   }
 
    if (con->contype != CONSTRAINT_CHECK)
        ereport(ERROR,