Re: Simplified version of read_binary_file (src/backend/utils/adt/genfile.c) - Mailing list pgsql-hackers

From Ranier Vilela
Subject Re: Simplified version of read_binary_file (src/backend/utils/adt/genfile.c)
Date
Msg-id CAEudQArwvEE=6r25DheQjtXTOeyfKVnHXiPfCN3LOso0KYkAOw@mail.gmail.com
Whole thread Raw
In response to Re: Simplified version of read_binary_file (src/backend/utils/adt/genfile.c)  (Andres Freund <andres@anarazel.de>)
Responses Re: Simplified version of read_binary_file (src/backend/utils/adt/genfile.c)  (Ranier Vilela <ranier.vf@gmail.com>)
List pgsql-hackers
Em sex., 11 de set. de 2020 às 15:09, Andres Freund <andres@anarazel.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@2ndquadrant.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.

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

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: factorial function/phase out postfix operators?
Next
From: John Naylor
Date:
Subject: Re: WIP: BRIN multi-range indexes