Re: clean up size_t/ssize_t use with POSIX file system APIs - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: clean up size_t/ssize_t use with POSIX file system APIs
Date
Msg-id 0db5d34c-b32f-431f-b5ac-fd64417a6d88@eisentraut.org
Whole thread
In response to Re: clean up size_t/ssize_t use with POSIX file system APIs  (Heikki Linnakangas <hlinnaka@iki.fi>)
List pgsql-hackers
On 06.07.26 14:38, Heikki Linnakangas wrote:
> Should probably change the 'i' into size_t as well, since it's compared 
> with 'nread'. And 'nlines' too, to be pendantic, so that it doesn't 
> overflow if you have a 10 GB file full of newlines..
> 
> As a sanity check though, it'd probably make sense to check that the 
> file is not larger than a few kB or so. This is used to read the pid 
> file and postmaster.opts file, neither of which is expected to be large.

This patch set has been committed.

I changed the type of 'i' to match nread.  The other changes I attempted 
but they would have crept into more and more places, so I stopped.  We 
can keep that for a separate small project.  I suspect similar 
treatments might be appropriate elsewhere, too.




pgsql-hackers by date:

Previous
From: Akshay Joshi
Date:
Subject: Re: [PATCH] Add pg_get_table_ddl() to reconstruct CREATE TABLE statements
Next
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: Follow-up fixes for online wal_level change