Re: Add BufFileRead variants with short read and EOF detection

2023-01-16 Thread Peter Eisentraut
On 14.01.23 07:01, Amit Kapila wrote: On Thu, Jan 12, 2023 at 2:44 PM Peter Eisentraut wrote: On 10.01.23 07:20, Amit Kapila wrote: Yeah, we can do that but not sure if it is worth doing any of those because there are already other places that don't use the exact context. Ok, updated patche

Re: Add BufFileRead variants with short read and EOF detection

2023-01-13 Thread Amit Kapila
On Thu, Jan 12, 2023 at 2:44 PM Peter Eisentraut wrote: > > On 10.01.23 07:20, Amit Kapila wrote: > > Yeah, we can do that but not sure if it is worth doing any of those > > because there are already other places that don't use the exact > > context. > > Ok, updated patches attached. > Both the p

Re: Add BufFileRead variants with short read and EOF detection

2023-01-12 Thread Peter Eisentraut
On 10.01.23 07:20, Amit Kapila wrote: The existing uses of %m are wrong. This was already fixed once in 7897e3bb902c557412645b82120f4d95f7474906, but the affected areas of code were apparently developed at around the same time and didn't get the fix. So I have attached a separate patch to fix t

Re: Add BufFileRead variants with short read and EOF detection

2023-01-09 Thread Amit Kapila
On Fri, Jan 6, 2023 at 6:18 PM Peter Eisentraut wrote: > > On 02.01.23 13:13, Amit Kapila wrote: > > On Wed, Dec 28, 2022 at 4:17 PM Peter Eisentraut > > wrote: > >> > >> Most callers of BufFileRead() want to check whether they read the full > >> specified length. Checking this at every call sit

Re: Add BufFileRead variants with short read and EOF detection

2023-01-06 Thread Peter Eisentraut
On 02.01.23 13:13, Amit Kapila wrote: On Wed, Dec 28, 2022 at 4:17 PM Peter Eisentraut wrote: Most callers of BufFileRead() want to check whether they read the full specified length. Checking this at every call site is very tedious. This patch provides additional variants BufFileReadExact() a

Re: Add BufFileRead variants with short read and EOF detection

2023-01-03 Thread vignesh C
On Wed, 28 Dec 2022 at 16:17, Peter Eisentraut wrote: > > Most callers of BufFileRead() want to check whether they read the full > specified length. Checking this at every call site is very tedious. > This patch provides additional variants BufFileReadExact() and > BufFileReadMaybeEOF() that incl

Re: Add BufFileRead variants with short read and EOF detection

2023-01-02 Thread Amit Kapila
On Wed, Dec 28, 2022 at 4:17 PM Peter Eisentraut wrote: > > Most callers of BufFileRead() want to check whether they read the full > specified length. Checking this at every call site is very tedious. > This patch provides additional variants BufFileReadExact() and > BufFileReadMaybeEOF() that in