pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Why does TupleDescInitBuiltinEntry lack a "default: error" case?
2+ messages / 2 participants
[nested] [flat]

Commits from this thread:
  2018-12-10 b7a29695f7 a628e0c5b4 9eaba23c41  Make TupleDescInitBuiltinEntry throw error for unsupported types.
* Why does TupleDescInitBuiltinEntry lack a "default: error" case?
@ 2018-12-09 19:49  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: Tom Lane @ 2018-12-09 19:49 UTC (permalink / raw)
  To: pgsql-hackers@lists.postgresql.org

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




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Why does TupleDescInitBuiltinEntry lack a "default: error" case?
@ 2018-12-09 20:04  Andres Freund <andres@anarazel.de>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Andres Freund @ 2018-12-09 20:04 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-hackers@lists.postgresql.org

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




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2018-12-09 20:04 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-12-09 19:49 Why does TupleDescInitBuiltinEntry lack a "default: error" case? Tom Lane <tgl@sss.pgh.pa.us>
2018-12-09 20:04 ` Andres Freund <andres@anarazel.de>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox