Re: WriteBuffer return value - Mailing list pgsql-patches

From Tom Lane
Subject Re: WriteBuffer return value
Date
Msg-id 9398.1023891557@sss.pgh.pa.us
Whole thread Raw
In response to WriteBuffer return value  (Manfred Koizar <mkoi-pg@aon.at>)
Responses Re: WriteBuffer return value
List pgsql-patches
Manfred Koizar <mkoi-pg@aon.at> writes:
> Fix WriteBuffer() to return STATUS_OK/STATUS_ERROR instead of
> TRUE/FALSE.  The return value is used by nextval() and do_setval()
> in sequence.c,  all other callers ignore the return value.

Given the lack of any error checks in 99% of the callers, I do not think
this is an appropriate change.  I'd vote for changing WriteBuffer to
return void, and have it elog() on bad argument.  No one should ever
pass it a bogus buffer ID anyway --- if you don't have a valid buffer
ID, then what the heck were you just scribbling on?

            regards, tom lane

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: GUC option log_pid is not checked [Fwd: Bug#149675: Fix]
Next
From: "Dave Page"
Date:
Subject: Re: [ODBC] UI Update (was: int8 becames string in BDE :-()