Re: pg_read_file() with virtual files returns empty string - Mailing list pgsql-hackers

From Joe Conway
Subject Re: pg_read_file() with virtual files returns empty string
Date
Msg-id 84baf4c5-e89a-4716-5852-2a3245e69d90@joeconway.com
Whole thread Raw
In response to Re: pg_read_file() with virtual files returns empty string  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pg_read_file() with virtual files returns empty string
List pgsql-hackers
On 7/2/20 5:37 PM, Tom Lane wrote:
> Joe Conway <mail@joeconway.com> writes:
>> In fact, in principle there is no reason we can't get to max - 4 with this code
>> except that when the filesize is exactly 1073741819, we need to try to read one
>> more byte to find the EOF that way I did in my patch. I.e.:
>
> Ah, right, *that* is where the extra byte is lost: we need a buffer
> workspace one byte more than the file size, or we won't ever actually
> see the EOF indication.
>
> I still can't get excited about contorting the code to remove that
> issue.

It doesn't seem much worse than the oom test that was there before -- see attached.

In any case I will give you the last word and then quit bugging you about it ;-)

Are we in agreement that whatever gets pushed should be backpatched through pg11
(see start of thread)?

Joe

--
Crunchy Data - http://crunchydata.com
PostgreSQL Support for Secure Enterprises
Consulting, Training, & Open Source Development

Attachment

pgsql-hackers by date:

Previous
From: Jehan-Guillaume de Rorthais
Date:
Subject: Re: [patch] demote
Next
From: Tom Lane
Date:
Subject: Re: pg_read_file() with virtual files returns empty string