Make TupleDescInitBuiltinEntry throw error for unsupported types.
authorTom Lane
Mon, 10 Dec 2018 15:38:49 +0000 (10:38 -0500)
committerTom Lane
Mon, 10 Dec 2018 15:38:49 +0000 (10:38 -0500)
Previously, it would just pass back a partially-uninitialized tupdesc,
which doesn't seem like a safe or useful behavior.

Backpatch to v10 where this code came in.

Discussion: https://postgr.es/m/30830.1544384975@sss.pgh.pa.us

src/backend/access/common/tupdesc.c

index b0434b467208bc19e2a3bd76453a3a1cedc31235..852b96ebbbf6ebc2db4ef2848c3cce1c4ccb8c4a 100644 (file)
@@ -748,6 +748,9 @@ TupleDescInitBuiltinEntry(TupleDesc desc,
            att->attstorage = 'p';
            att->attcollation = InvalidOid;
            break;
+
+       default:
+           elog(ERROR, "unsupported type %u", oidtypeid);
    }
 }