Re: Simplified version of read_binary_file (src/backend/utils/adt/genfile.c)

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Simplified version of read_binary_file (src/backend/utils/adt/genfile.c)
Date: 2020-09-11 19:09:03
Message-ID: CAEudQArwvEE=6r25DheQjtXTOeyfKVnHXiPfCN3LOso0KYkAOw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Em sex., 11 de set. de 2020 às 15:09, Andres Freund <andres(at)anarazel(dot)de>
escreveu:

> On 2020-09-11 14:10:31 -0300, Ranier Vilela wrote:
> > Em sex., 11 de set. de 2020 às 14:01, Alvaro Herrera <
> > alvherre(at)2ndquadrant(dot)com> escreveu:
> > > On 2020-Sep-11, Ranier Vilela wrote:
> > > This code was very recently rewritten in 96d1f423f95d, and I doubt that
> > > taking out half the algorithm without studying how it got that way is a
> > > great idea.
> > >
> > Works with all regress tests (199, same as the HEAD with msvc 2019 64
> bits
> > except partition_prune)
> > Works with pgbench (pgbench -U postgres -c 50 -j 2 -t 10000 example)
> > And works with local installation, without adverse effects, for now.
>
> Have your read the commit message for 96d1f423f95d ?
>
Yead, I read.
He's concerned about virtual file (pipe, FIFO, socket).
The patch ( 96d1f423f95d ) has the same problem.
fseeko with virtual file can fail too.

https://man7.org/linux/man-pages/man3/fseek.3.html
ESPIPE The file descriptor underlying stream is not seekable (e.g.,
it refers to a pipe, FIFO, or socket)

Call read_binary_file with virtual file,will log in:
"could not seek in file"

regards,
Ranier Vilela

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message John Naylor 2020-09-11 19:19:58 Re: WIP: BRIN multi-range indexes
Previous Message Tom Lane 2020-09-11 18:25:27 Re: factorial function/phase out postfix operators?