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

2020-09-15 Thread Ranier Vilela
Em ter., 15 de set. de 2020 às 14:54, Alvaro Herrera < alvhe...@2ndquadrant.com> escreveu: > I think you meant _IONBF instead of _IOFBF -- otherwise it's at odds > with the comment you add. But what is the justification for that > addition? I don't see us doing that anywhere else. > No. _IOFBF

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

2020-09-15 Thread Alvaro Herrera
I think you meant _IONBF instead of _IOFBF -- otherwise it's at odds with the comment you add. But what is the justification for that addition? I don't see us doing that anywhere else. -- Álvaro Herrerahttps://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote

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

2020-09-15 Thread Ranier Vilela
Em sex., 11 de set. de 2020 às 18:43, Ranier Vilela escreveu: > Em sex., 11 de set. de 2020 às 17:44, Tom Lane > escreveu: > >> Ranier Vilela writes: >> > New version, with support to read Virtual File (pipe, FIFO and socket). >> > With assert, in case, erroneous, of trying to read a pipe,

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

2020-09-14 Thread Ranier Vilela
Em sex., 11 de set. de 2020 às 17:44, Tom Lane escreveu: > Ranier Vilela writes: > > New version, with support to read Virtual File (pipe, FIFO and socket). > > With assert, in case, erroneous, of trying to read a pipe, with offset. > > I do agree that it might be worth skipping the fseeko call

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

2020-09-11 Thread Ranier Vilela
Em sex., 11 de set. de 2020 às 17:44, Tom Lane escreveu: > Ranier Vilela writes: > > New version, with support to read Virtual File (pipe, FIFO and socket). > > With assert, in case, erroneous, of trying to read a pipe, with offset. > > Really, could you do a little more thinking and testing of

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

2020-09-11 Thread Tom Lane
Ranier Vilela writes: > New version, with support to read Virtual File (pipe, FIFO and socket). > With assert, in case, erroneous, of trying to read a pipe, with offset. Really, could you do a little more thinking and testing of your own, rather than expecting the rest of us to point out holes

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

2020-09-11 Thread Ranier Vilela
New version, with support to read Virtual File (pipe, FIFO and socket). With assert, in case, erroneous, of trying to read a pipe, with offset. regards, Ranier Vilela v2-0001-simplified_read_binary_file.patch Description: Binary data

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

2020-09-11 Thread Ranier Vilela
Em sex., 11 de set. de 2020 às 15:09, Andres Freund escreveu: > On 2020-09-11 14:10:31 -0300, Ranier Vilela wrote: > > Em sex., 11 de set. de 2020 às 14:01, Alvaro Herrera < > > alvhe...@2ndquadrant.com> escreveu: > > > On 2020-Sep-11, Ranier Vilela wrote: > > > This code was very recently

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

2020-09-11 Thread Andres Freund
On 2020-09-11 14:10:31 -0300, Ranier Vilela wrote: > Em sex., 11 de set. de 2020 às 14:01, Alvaro Herrera < > alvhe...@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

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

2020-09-11 Thread Ranier Vilela
Em sex., 11 de set. de 2020 às 14:01, Alvaro Herrera < alvhe...@2ndquadrant.com> escreveu: > On 2020-Sep-11, Ranier Vilela wrote: > > > Hi, > > > > read_binary_file seems a bit complicated when we want to read the rest of > > the file (-1 for bytes_to_read). > > This code was very recently

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

2020-09-11 Thread Alvaro Herrera
On 2020-Sep-11, Ranier Vilela wrote: > Hi, > > read_binary_file seems a bit complicated when we want to read the rest of > the file (-1 for bytes_to_read). This code was very recently rewritten in 96d1f423f95d, and I doubt that taking out half the algorithm without studying how it got that way

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

2020-09-11 Thread Ranier Vilela
Hi, read_binary_file seems a bit complicated when we want to read the rest of the file (-1 for bytes_to_read). This version, it seems, has no opposite effects, someone can confirm? regards, Ranier Vilela v1-0001-simplified_read_binary_file.patch Description: Binary data