Re: pg_read_file() with virtual files returns empty string

From: Joe Conway <mail(at)joeconway(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: pg_read_file() with virtual files returns empty string
Date: 2020-07-02 22:24:44
Message-ID: 84baf4c5-e89a-4716-5852-2a3245e69d90@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 7/2/20 5:37 PM, Tom Lane wrote:
> Joe Conway <mail(at)joeconway(dot)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 Content-Type Size
read-virtual-files.06.patch text/x-patch 4.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-07-02 22:29:46 Re: pg_read_file() with virtual files returns empty string
Previous Message Jehan-Guillaume de Rorthais 2020-07-02 22:12:10 Re: [patch] demote