Thread: More explicit documentation neede on "pgpass"

More explicit documentation neede on "pgpass"

From
PG Doc comments form
Date:
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/14/libpq-pgpass.html
Description:

The subdirectory of $APPDATA$ should be stated explicitly in the
documentation. The choices are "\AppData\Local", "\AppData\LocalLow", and
"\AppData\Roaming". There is no good reason to make the user guess where to
create it when the address C:\Users\geoff\AppData is known and loved (but
obviously not the correct answer).

34.16. The Password File
The file .pgpass in a user's home directory 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
%APPDATA%\postgresql\pgpass.conf (where %APPDATA% refers to the Application
Data subdirectory in the user's profile). Alternatively, the password file
to use can be specified using the connection parameter passfile or the
environment variable PGPASSFILE.

Re: More explicit documentation neede on "pgpass"

From
Laurenz Albe
Date:
On Mon, 2022-10-03 at 13:50 +0000, PG Doc comments form wrote:
> The following documentation comment has been logged on the website:
> 
> Page: https://www.postgresql.org/docs/14/libpq-pgpass.html
> Description:
> 
> The subdirectory of $APPDATA$ should be stated explicitly in the
> documentation. The choices are "\AppData\Local", "\AppData\LocalLow", and
> "\AppData\Roaming".

The subdirectory *is* stated: it is "%APPDATA%\postgresql".  You might have
to create that directory.

Yours,
Laurenz Albe



Re: More explicit documentation neede on "pgpass"

From
Julien Rouhaud
Date:
Hi,

On Mon, Oct 03, 2022 at 01:50:26PM +0000, PG Doc comments form wrote:
> The following documentation comment has been logged on the website:
> 
> Page: https://www.postgresql.org/docs/14/libpq-pgpass.html
> Description:
> 
> The subdirectory of $APPDATA$ should be stated explicitly in the
> documentation. The choices are "\AppData\Local", "\AppData\LocalLow", and
> "\AppData\Roaming". There is no good reason to make the user guess where to
> create it when the address C:\Users\geoff\AppData is known and loved (but
> obviously not the correct answer).

The documentation says %APPDATA%, not $APPDATA$.  That's a system variable
that you can use in the explorer or a command prompt, that will tell you where
it the directory on your machine (you could alternatively look at Windows
documentation to get the same answer).  It seems to have frequently changed
across Windows versions, which is why we can't document where it actually is.



Re: More explicit documentation neede on "pgpass"

From
Geoff Michaels
Date:
Thanks. I had missed the distinction between $APPDATA$ and %APPDATA%. I will assume that I will find that %APPDATA% defaults to ...\APPDATA\ROAMING. 

If one is inspired to try to "idiot-proof" the documentation, one could insert the parenthetical expression "(typically \AppData\Roaming)" for those that use Windows out of the box and are directed to bonafide documentation that assumes a lot about the users.


--
Geoff Michaels, President
G. Michaels Consulting Ltd
Phone (866 or 780) 438-2101

Prod me to add more DBDOC Techniques and News


On Mon, Oct 3, 2022 at 9:11 AM Julien Rouhaud <rjuju123@gmail.com> wrote:
Hi,

On Mon, Oct 03, 2022 at 01:50:26PM +0000, PG Doc comments form wrote:
> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/14/libpq-pgpass.html
> Description:
>
> The subdirectory of $APPDATA$ should be stated explicitly in the
> documentation. The choices are "\AppData\Local", "\AppData\LocalLow", and
> "\AppData\Roaming". There is no good reason to make the user guess where to
> create it when the address C:\Users\geoff\AppData is known and loved (but
> obviously not the correct answer).

The documentation says %APPDATA%, not $APPDATA$.  That's a system variable
that you can use in the explorer or a command prompt, that will tell you where
it the directory on your machine (you could alternatively look at Windows
documentation to get the same answer).  It seems to have frequently changed
across Windows versions, which is why we can't document where it actually is.

Re: More explicit documentation neede on "pgpass"

From
Julien Rouhaud
Date:
On Mon, Oct 03, 2022 at 09:25:58AM -0600, Geoff Michaels wrote:
> Thanks. I had missed the distinction between $APPDATA$ and %APPDATA%. I
> will assume that I will find that %APPDATA% defaults to
> ...\APPDATA\ROAMING.
> 
> If one is inspired to try to "idiot-proof" the documentation, one could
> insert the parenthetical expression "(typically \AppData\Roaming)" for
> those that use Windows out of the box and are directed to bonafide
> documentation that assumes a lot about the users.

Current Windows documentation says for CSIDL_APPDATA / FOLDERID_RoamingAppData
at https://learn.microsoft.com/en-us/windows/win32/shell/csidl:

> The file system directory that serves as a common repository for
> application-specific data. A typical path is C:\Documents and
> Settings\username\Application Data.

I was never able to find out what "typical" exactly mean.  Is it something
configurable, or that can change at any point without any notice?  I personally
don't think that trying to put some example value that may not be accurate for
the user is going to help, especially if that's not true on all currently
supported versions of Windows (and I don't know if that's the case, and even if
it's right now we will most certainly forget to update it the next time it
changes).  Relying on dynamic variable resolution really seems like the best
thing to do.



Re: More explicit documentation neede on "pgpass"

From
Geoff Michaels
Date:
I appreciate and respect the efforts made here to help one simple user. The Microsoft reference says it is valid up to Windows Vista, so it is an excellent example of how things continue changing.

I would define, as an amateur, of course, "typical" to mean "the way it is out of the box when you don't change it in the current version of Windows released at least a year ago". We deal with a community of users that does not customize Windows but uses it as it.

I fully expect that I will only encounter \AppData\Roaming but I know how to find the right answer if I need a better one. Thanks, again, for dedicated support and ideas.
--
Geoff Michaels, President
G. Michaels Consulting Ltd
Phone (866 or 780) 438-2101

Prod me to add more DBDOC Techniques and News


On Mon, Oct 3, 2022 at 10:10 AM Julien Rouhaud <rjuju123@gmail.com> wrote:
On Mon, Oct 03, 2022 at 09:25:58AM -0600, Geoff Michaels wrote:
> Thanks. I had missed the distinction between $APPDATA$ and %APPDATA%. I
> will assume that I will find that %APPDATA% defaults to
> ...\APPDATA\ROAMING.
>
> If one is inspired to try to "idiot-proof" the documentation, one could
> insert the parenthetical expression "(typically \AppData\Roaming)" for
> those that use Windows out of the box and are directed to bonafide
> documentation that assumes a lot about the users.

Current Windows documentation says for CSIDL_APPDATA / FOLDERID_RoamingAppData
at https://learn.microsoft.com/en-us/windows/win32/shell/csidl:

> The file system directory that serves as a common repository for
> application-specific data. A typical path is C:\Documents and
> Settings\username\Application Data.

I was never able to find out what "typical" exactly mean.  Is it something
configurable, or that can change at any point without any notice?  I personally
don't think that trying to put some example value that may not be accurate for
the user is going to help, especially if that's not true on all currently
supported versions of Windows (and I don't know if that's the case, and even if
it's right now we will most certainly forget to update it the next time it
changes).  Relying on dynamic variable resolution really seems like the best
thing to do.