Win32 config file extension, capitalization - Mailing list pgsql-hackers

From Bruce Momjian
Subject Win32 config file extension, capitalization
Date
Msg-id 200501131556.j0DFuCM28308@candle.pha.pa.us
Whole thread Raw
In response to Re: [pgsql-hackers-win32] [BUGS] More SSL questions..  (Kevin Brown <kevin@sysexperts.com>)
Responses Re: Win32 config file extension, capitalization
List pgsql-hackers
Kevin Brown wrote:
> Bruce Momjian wrote:
> > > > FWIW, I've seen several apps that use .txt for config files, but I can't
> > > > think of an example right now. Most don't though - .cfg or .conf is
> > > > probably most common. Except for the majority of windows programs that
> > > > don't use config files - they use the registry. But I see no reason *at
> > > > all* for us to want to do that :-) It also more or less requires you to
> > > > write a GUI to change the config stuff and in that case the file
> > > > extension becomes irrelevant.
> > >
> > > Where are we on this?  I think Andrew and I both think *.txt is
> > > confusing.  We need to decide on Monday if we should change the current
> > > *.txt names.  We can either leave it unchanged, remove *.txt, or change
> > > it to *.config.
> >
> > > >>> APPDATA/postgresql/pgpass.txt
> > > >>> APPDATA/postgresql/psqlrc.txt
> >
> > Another idea is to use *.conf.
>
> For what it's worth, I always thought that text configuration files on
> Windows platforms generally used the '.ini' extension.  I believe on
> most Windows systems that extension is by default associated with
> Notepad.

The problem with *.ini is that it suggests we follow the INI file format
for those files, which we don't.

Given the recent votes I have made the following patch which changes the
*.txt extensions to *.conf.  It is consistent with our other config
files on the server side.  This change is for Win32 only.  I will apply
for 8.0 soon.

One additional issue is that we currently specify the client directory
as %APPDATA%\postgresql\, but in my "Application Data" directory most of
my directories are upper/lower case, suggesting that we should use
%APPDATA%\PostgreSQL\.  Win32 is case-insensitve but case-preserving so
they directory could be created with any case but it seems we should
suggest directory capitalization more consistent with Win32.

Comments?

We are at the point where we are really just polishing Win32 and these
issues are all cosmetic.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
Index: doc/src/sgml/libpq.sgml
===================================================================
RCS file: /cvsroot/pgsql/doc/src/sgml/libpq.sgml,v
retrieving revision 1.177
diff -c -c -r1.177 libpq.sgml
*** doc/src/sgml/libpq.sgml    8 Jan 2005 22:13:28 -0000    1.177
--- doc/src/sgml/libpq.sgml    13 Jan 2005 15:47:39 -0000
***************
*** 3883,3889 ****
  that can contain passwords to be used if the connection requires a
  password (and no password has been specified otherwise).
  On Microsoft Windows the file is named
! <filename>%APPDATA%\postgresql\pgpass.txt</> (where <filename>%APPDATA%</>
  refers to the Application Data subdirectory in the user's profile).
  </para>

--- 3883,3889 ----
  that can contain passwords to be used if the connection requires a
  password (and no password has been specified otherwise).
  On Microsoft Windows the file is named
! <filename>%APPDATA%\postgresql\pgpass.conf</> (where <filename>%APPDATA%</>
  refers to the Application Data subdirectory in the user's profile).
  </para>

Index: doc/src/sgml/ref/psql-ref.sgml
===================================================================
RCS file: /cvsroot/pgsql/doc/src/sgml/ref/psql-ref.sgml,v
retrieving revision 1.129
diff -c -c -r1.129 psql-ref.sgml
*** doc/src/sgml/ref/psql-ref.sgml    6 Jan 2005 21:20:44 -0000    1.129
--- doc/src/sgml/ref/psql-ref.sgml    13 Jan 2005 15:47:45 -0000
***************
*** 2525,2531 ****
       <filename>psqlrc</filename> file and the user's
       <filename>~/.psqlrc</filename> file.
       (On Windows, the user's startup file is named
!      <filename>%APPDATA%\postgresql\psqlrc.txt</filename>.)
       See <filename><replaceable>PREFIX</>/share/psqlrc.sample</>
       for information on setting up the system-wide file.  It could be used
       to set up the client or the server to taste (using the <command>\set
--- 2525,2531 ----
       <filename>psqlrc</filename> file and the user's
       <filename>~/.psqlrc</filename> file.
       (On Windows, the user's startup file is named
!      <filename>%APPDATA%\postgresql\psqlrc.conf</filename>.)
       See <filename><replaceable>PREFIX</>/share/psqlrc.sample</>
       for information on setting up the system-wide file.  It could be used
       to set up the client or the server to taste (using the <command>\set
Index: src/bin/psql/startup.c
===================================================================
RCS file: /cvsroot/pgsql/src/bin/psql/startup.c,v
retrieving revision 1.109
diff -c -c -r1.109 startup.c
*** src/bin/psql/startup.c    6 Jan 2005 18:29:09 -0000    1.109
--- src/bin/psql/startup.c    13 Jan 2005 15:47:51 -0000
***************
*** 48,54 ****
  #define PSQLRC        ".psqlrc"
  #else
  #define SYSPSQLRC    "psqlrc"
! #define PSQLRC        "psqlrc.txt"
  #endif

  /*
--- 48,54 ----
  #define PSQLRC        ".psqlrc"
  #else
  #define SYSPSQLRC    "psqlrc"
! #define PSQLRC        "psqlrc.conf"
  #endif

  /*
Index: src/interfaces/libpq/fe-connect.c
===================================================================
RCS file: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v
retrieving revision 1.300
diff -c -c -r1.300 fe-connect.c
*** src/interfaces/libpq/fe-connect.c    10 Jan 2005 00:19:43 -0000    1.300
--- src/interfaces/libpq/fe-connect.c    13 Jan 2005 15:47:57 -0000
***************
*** 69,75 ****
  #ifndef WIN32
  #define PGPASSFILE ".pgpass"
  #else
! #define PGPASSFILE "pgpass.txt"
  #endif

  /* fall back options if they are not specified by arguments or defined
--- 69,75 ----
  #ifndef WIN32
  #define PGPASSFILE ".pgpass"
  #else
! #define PGPASSFILE "pgpass.conf"
  #endif

  /* fall back options if they are not specified by arguments or defined

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Much Ado About COUNT(*)
Next
From: "D'Arcy J.M. Cain"
Date:
Subject: Re: Much Ado About COUNT(*)