Thread

Commits

  1. Make TupleDescInitBuiltinEntry throw error for unsupported types.

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

    Tom Lane <tgl@sss.pgh.pa.us> — 2018-12-09T19:49:35Z

    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
    
    
    
  2. Re: Why does TupleDescInitBuiltinEntry lack a "default: error" case?

    Andres Freund <andres@anarazel.de> — 2018-12-09T20:04:53Z

    Hi,
    
    On 2018-12-09 14:49:35 -0500, Tom Lane wrote:
    > 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?
    
    +1
    
    Greetings,
    
    Andres Freund