Error handling expectations

From: James Coleman <jtc331(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Error handling expectations
Date: 2018-10-15 17:21:04
Message-ID: CAAaqYe_=kbL8vB0gai76C9RcTh5E3NsZC++BzstVQm=+0Hqt0w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I'm working on adding a tuple_data_record function to pageinspect to
parallel tuple_data_split (returning the record type of the relation being
examined rather than an array of attributes as on-disk byte data).

This my first real foray into the Postgres codebase, so an beginner
question: I noticed that existing C functions in pageinspect often do error
checking and then report the error with ereport but still continue on to
execute the rest of the function instead of early returning. Is this
standard practice? Or should I be reporting the error and then cleaning up
and returning rather than continuing to execute?

Thanks,
James Coleman

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2018-10-15 17:28:26 Re: Error handling expectations
Previous Message Tom Lane 2018-10-15 17:00:38 Re: Re[2]: [PATCH] Change simple_heap_insert() to a macro