Why does TupleDescInitBuiltinEntry lack a "default: error" case?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Why does TupleDescInitBuiltinEntry lack a "default: error" case?
Date: 2018-12-09 19:49:35
Message-ID: 30830.1544384975@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

If the passed-in type OID isn't one of the very short list that
TupleDescInitBuiltinEntry supports, it will silently hand back
a broken TupleDesc, rather than throwing an error. How can
this possibly be considered good code?

(So far as I can see, none of the extant callers could hit
such an error, but it's still bad code.)

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2018-12-09 20:04:53 Re: Why does TupleDescInitBuiltinEntry lack a "default: error" case?
Previous Message Alexander Korotkov 2018-12-09 19:25:43 Re: Connections hang indefinitely while taking a gin index's LWLock buffer_content lock