Skip site navigation (1) Skip section navigation (2)

ReadBuffer() error checking

From: Neil Conway <neilc(at)samurai(dot)com>
To: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: ReadBuffer() error checking
Date: 2004-11-13 08:41:33
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches
AFAIK, ReadBuffer() will elog on error, so callers can assume that the 
buffer it returns is valid. The vast majority of ReadBuffer() call sites 
make this assumption, but some went to the trouble of checking that the 
returned buffer was valid and elog'ing if it was not. I've removed the 
error checking from the latter since it is dead code.

I thought about adding an assertion (or even a precautionary 
elog(ERROR)) to ReadBuffer to verify that the returned buffer is indeed 
valid, but I didn't end up doing it. Feel free to raise your hand if you 
think this is a good idea.

Barring any objections, I'll apply the attached patch to HEAD tomorrow.


Attachment: read-buffer-error-cleanup-1.patch
Description: text/plain (4.5 KB)


pgsql-patches by date

Next:From: Neil ConwayDate: 2004-11-13 08:45:36
Subject: Re: PITR docs enhancements
Previous:From: Robert TreatDate: 2004-11-13 05:51:37
Subject: Give the TODO list a little more verbose explanation

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group