Re: Use of PG_BINARY_R and "r"

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Use of PG_BINARY_R and "r"
Date: 2002-03-22 19:12:40
Message-ID: 200203221912.g2MJCea25048@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > My assumption is that text files should use "r" and binary files use
> > PG_BINARY_R.
>
> I believe that's correct. It seems kinda inconsistent though.
>
> > For example, in 7.2 I see pg_hba.conf opened with "r" and pg_ident.conf
> > opened with PG_BINARY_R.
>
> The latter is clearly wrong, since pg_ident.conf is not binary.
>
> Is there any interest in defining
> #define PG_TEXT_R "r"
> #define PG_TEXT_W "w"
> so that AllocateFile is always called with one of this set of macros?
> Or is that just silly?

I kind of like that. The problem I think is that we use "r" in some
places so people assume it is just like ordinary open() args, which it
is unless it is a binary file, where you have to use the macro. That
seems kind of confusing.

However, we don't do this very often so just cleaning up what we have
may be enough.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-03-22 19:20:09 Re: SET NULL / SET NOT NULL
Previous Message Neil Conway 2002-03-22 19:12:02 Re: SET NULL / SET NOT NULL