Re: Incorrect Assert in BufFileSize()?

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Peter Geoghegan <pg@bowt.ie>, PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2024-07-03T16:19:18Z
Lists: pgsql-hackers
David Rowley <dgrowleyml@gmail.com> writes:
> I've attached an updated patch which updates the comments and also
> removes the misplaced Asserts from BufFileAppend.
> If there are no objections or additional feedback, I'll push this patch soon.

- * Return the current fileset based BufFile size.
+ * Returns the size if the given BufFile in bytes.

"Returns the size of", no doubt?

A shade less nit-pickily, I wonder if "size" is sufficient.
It's not really obvious that this means the amount of data
in the file, rather than say sizeof(BufFile).  How about

+ * Returns the amount of data in the given BufFile, in bytes.

LGTM other than that point.

			regards, tom lane



Commits

  1. Remove incorrect Asserts in buffile.c