]> granicus.if.org Git - postgresql/commitdiff
Make TupleDescInitBuiltinEntry throw error for unsupported types.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 10 Dec 2018 15:38:48 +0000 (10:38 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 10 Dec 2018 15:38:48 +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 5354a04639b5fd55849333b32ad863a42c68d2f2..e3e4ab636bb958359f843143993291040650f6f6 100644 (file)
@@ -744,6 +744,9 @@ TupleDescInitBuiltinEntry(TupleDesc desc,
                        att->attstorage = 'p';
                        att->attcollation = InvalidOid;
                        break;
+
+               default:
+                       elog(ERROR, "unsupported type %u", oidtypeid);
        }
 }