Thread: Re: [pgsql-hackers-win32] [BUGS] More SSL questions..

Re: [pgsql-hackers-win32] [BUGS] More SSL questions..

From
Bruce Momjian
Date:
Magnus Hagander wrote:
> >> My feeling is that the *.txt is actually misleading because
> >people will
> >> think of it as a file full of freeform text (paragraphs) and not a
> >> configuration file.
> >
> >Why would they think that?  If notepad tends to auto-wrap files then
> >this argument has some force; I'm not very familar with it though.
>
> It does not. There is an option to make it *show* the file with wrapped
> line, but it does not even have the capability to wordwrap the files
> themselves.
>
> 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.

Currently the two Win32 files with *.txt extensions are:

    > >>> APPDATA/postgresql/pgpass.txt
    > >>> APPDATA/postgresql/psqlrc.txt

*.txt was added on Win32 to make them automatically start notepad.exe
when clicked on.  Here is a copy of the Mozilla directory on XP:

    [.]                [..]               1138945.s          1138945.w
    abook.mab          bookmarks-1.html   bookmarks-2.html   bookmarks-3.html
    bookmarks-4.html   bookmarks-5.html   bookmarks-6.html   bookmarks.html
    [Cache]            [Cache.Trash]      cert8.db           [chatzilla]
    [chrome]           cookies.txt        cookperm.txt       downloads.rdf
    history.dat        history.mab        hostperm.1         key3.db
    localstore.rdf     [Mail]             mailViews.dat      mimeTypes.rdf
    panacea.dat        panels.rdf         parent.lock        prefs.js
    search.rdf         secmod.db          URL.tbl            XUL.mfl

There are no *.txt files even though they are all text files.  They are
not meant to be edited by hand though.  I don't have any *.txt files
under \Application Data on my machine.

--
  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

Re: [pgsql-hackers-win32] [BUGS] More SSL questions..

From
Bruce Momjian
Date:
Bruce Momjian wrote:
>     [.]                [..]               1138945.s          1138945.w
>     abook.mab          bookmarks-1.html   bookmarks-2.html   bookmarks-3.html
>     bookmarks-4.html   bookmarks-5.html   bookmarks-6.html   bookmarks.html
>     [Cache]            [Cache.Trash]      cert8.db           [chatzilla]
>     [chrome]           cookies.txt        cookperm.txt       downloads.rdf
>     history.dat        history.mab        hostperm.1         key3.db
>     localstore.rdf     [Mail]             mailViews.dat      mimeTypes.rdf
>     panacea.dat        panels.rdf         parent.lock        prefs.js
>     search.rdf         secmod.db          URL.tbl            XUL.mfl
>
> There are no *.txt files even though they are all text files.  They are

Oops, sorry there are two *.txt files for cookies, but most of the
configuration files are not *.txt.

--
  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

Re: [pgsql-hackers-win32] [BUGS] More SSL questions..

From
Bruce Momjian
Date:
Bruce Momjian wrote:
> Magnus Hagander wrote:
> > >> My feeling is that the *.txt is actually misleading because
> > >people will
> > >> think of it as a file full of freeform text (paragraphs) and not a
> > >> configuration file.
> > >
> > >Why would they think that?  If notepad tends to auto-wrap files then
> > >this argument has some force; I'm not very familar with it though.
> >
> > It does not. There is an option to make it *show* the file with wrapped
> > line, but it does not even have the capability to wordwrap the files
> > themselves.
> >
> > 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.  We already have:

    pg_hba.conf
    pg_ident.conf
    pg_service.conf
    postgresql.conf
    recovery.conf

If we want an extension on those two files, it seems *.conf is it, and
one hopes they would have already configured XP to pull up their
favorite editor for *.conf.

--
  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

Re: [pgsql-hackers-win32] [BUGS] More SSL questions..

From
Kevin Brown
Date:
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.



-- 
Kevin Brown                          kevin@sysexperts.com


Win32 config file extension, capitalization

From
Bruce Momjian
Date:
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

Re: Win32 config file extension, capitalization

From
"Marc G. Fournier"
Date:
I have no problems with the patch ...

On Thu, 13 Jan 2005, Bruce Momjian wrote:

> 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
>

----
Marc G. Fournier           Hub.Org Networking Services (http://www.hub.org)
Email: scrappy@hub.org           Yahoo!: yscrappy              ICQ: 7615664