Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Make TupleDescInitBuiltinEntry throw error for unsupported types.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 10 Dec 2018 15:38:49 +0000 (10:38 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
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 9fd7b4e019bbfdb6198951ebcb30dc5b5e2f623a..129176f6b71743f9a1fc7d60a7e233209bb42252 100644 (file)
@@ -643,6 +643,9 @@ TupleDescInitBuiltinEntry(TupleDesc desc,
            att->attstorage = 'p';
            att->attcollation = InvalidOid;
            break;
+
+       default:
+           elog(ERROR, "unsupported type %u", oidtypeid);
    }
 }