Re: [BUGS] [HACKERS] 0x1A in control file on Windows

2008-09-24 Thread Magnus Hagander
Andrew Dunstan wrote: > > > Tom Lane wrote: >>> The point being that the config files are opened with AllocateFile(), >>> which in turn calls fopen(). It doesn't use open(). The proposal was >>> only to make all *open()* calls do it binary. I was under the impression >>> that on Unix, that's what

Re: [BUGS] [HACKERS] 0x1A in control file on Windows

2008-09-24 Thread Andrew Dunstan
Tom Lane wrote: The point being that the config files are opened with AllocateFile(), which in turn calls fopen(). It doesn't use open(). The proposal was only to make all *open()* calls do it binary. I was under the impression that on Unix, that's what open() did, so we should behave the same?

Re: [BUGS] [HACKERS] 0x1A in control file on Windows

2008-09-24 Thread Tom Lane
Magnus Hagander <[EMAIL PROTECTED]> writes: > Andrew Dunstan wrote: >> Tom Lane wrote: >>> If you need a positive reason why this might be a bad idea, consider the >>> idea that someone is examining postgresql.conf with a text editor that >>> stops reading at control-Z. He might not be able to see

Re: [BUGS] [HACKERS] 0x1A in control file on Windows

2008-09-24 Thread Magnus Hagander
Magnus Hagander wrote: > Andrew Dunstan wrote: >> >> Tom Lane wrote: >>> Bruce Momjian <[EMAIL PROTECTED]> writes: >>> Tom Lane wrote: > Well, why is that a bug? If the platform is so silly as to define text > files that way, who are we to argue? > >>> The

Re: [BUGS] [HACKERS] 0x1A in control file on Windows

2008-09-19 Thread Magnus Hagander
Andrew Dunstan wrote: > > > Magnus Hagander wrote: >> I had a chat with Heikki about this, and the proper way to fix it. >> >> Should there actually be any reason not to *always* open our files with >> O_BINARY? That seems to be what should mimic what Unix does, which would >> be what we expect,

Re: [BUGS] [HACKERS] 0x1A in control file on Windows

2008-09-19 Thread Andrew Dunstan
Magnus Hagander wrote: I had a chat with Heikki about this, and the proper way to fix it. Should there actually be any reason not to *always* open our files with O_BINARY? That seems to be what should mimic what Unix does, which would be what we expect, no? If that is so, then I propose we do

Re: [BUGS] [HACKERS] 0x1A in control file on Windows

2008-09-19 Thread Magnus Hagander
Magnus Hagander wrote: > Heikki Linnakangas wrote: >> ITAGAKI Takahiro wrote: >>> Tom Lane <[EMAIL PROTECTED]> wrote: >>> ITAGAKI Takahiro <[EMAIL PROTECTED]> writes: > We probably need to add PG_BINARY when we open control files > because 0x1A is an end-of-file marker on Windows.

Re: [BUGS] [HACKERS] 0x1A in control file on Windows

2008-09-18 Thread Magnus Hagander
Heikki Linnakangas wrote: > ITAGAKI Takahiro wrote: >> Tom Lane <[EMAIL PROTECTED]> wrote: >> >>> ITAGAKI Takahiro <[EMAIL PROTECTED]> writes: We probably need to add PG_BINARY when we open control files because 0x1A is an end-of-file marker on Windows. >>> Well, why is that a bug? If th

Re: [BUGS] [HACKERS] 0x1A in control file on Windows

2008-09-18 Thread Heikki Linnakangas
ITAGAKI Takahiro wrote: Tom Lane <[EMAIL PROTECTED]> wrote: ITAGAKI Takahiro <[EMAIL PROTECTED]> writes: We probably need to add PG_BINARY when we open control files because 0x1A is an end-of-file marker on Windows. Well, why is that a bug? If the platform is so silly as to define text files