Thread: Client parameter list omits timezone

Client parameter list omits timezone

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

Page: https://www.postgresql.org/docs/11/libpq-connect.html
Description:

I am looking for a complete list of parameters that I can pass in the
"connect"/"open database connection" list on the client (in this case,
github.com/lib/pq). 

The list of parameters documented here:
https://www.postgresql.org/docs/11/libpq-connect.html#LIBPQ-PARAMKEYWORDS
does not include the "timezone" parameter. However, github.com/lib/pq seems
to indicate that "timezone" is an acceptable parameter, for example, here:
https://github.com/lib/pq/blob/master/encode_test.go#L123

Elsewhere in the docs, the PGTZ environment variable can be used to set the
timezone on the client.

I would expect to see "timezone" (and anything else that can be configured)
in that list.

Re: Client parameter list omits timezone

From
Stephen Frost
Date:
Greetings,

* PG Doc comments form (noreply@postgresql.org) wrote:
> Page: https://www.postgresql.org/docs/11/libpq-connect.html
> Description:
>
> I am looking for a complete list of parameters that I can pass in the
> "connect"/"open database connection" list on the client (in this case,
> github.com/lib/pq).
>
> The list of parameters documented here:
> https://www.postgresql.org/docs/11/libpq-connect.html#LIBPQ-PARAMKEYWORDS
> does not include the "timezone" parameter. However, github.com/lib/pq seems
> to indicate that "timezone" is an acceptable parameter, for example, here:
> https://github.com/lib/pq/blob/master/encode_test.go#L123

The documentation you're looking at on postgresql.org is for the libpq
C driver (which is written and maintained as part of core PostgreSQL),
not for the Go driver that's at github.com/lib/pq.

For my part, it doesn't seem like a good idea for the Go driver to
deviate in this way, but you'd have to talk to the author of it about
that, not us.  Then again, that git repo also says at the bottom that
it's not actively being developed and recommends a different Go driver
be used.

> Elsewhere in the docs, the PGTZ environment variable can be used to set the
> timezone on the client.

This is true, for the libpq driver.  I don't know about the Go driver.

> I would expect to see "timezone" (and anything else that can be configured)
> in that list.

'timezone' isn't accepted by libpq, which is what our documentation is
referring to.

Thanks,

Stephen

Attachment

Re: Client parameter list omits timezone

From
Kevin Burke
Date:
I guess my broader issue is that it's hard to figure out how to configure things like the timezone in a given client. Generally, you pass some things as parameters in the connection string but it's not obvious which values are accepted or where to pass them, unless you go rooting around in the protocol details and the source code of the client, which is more than most users will or should be asked to do.

Kevin

On Sun, Jul 26, 2020 at 8:00 AM Stephen Frost <sfrost@snowman.net> wrote:
Greetings,

* PG Doc comments form (noreply@postgresql.org) wrote:
> Page: https://www.postgresql.org/docs/11/libpq-connect.html
> Description:
>
> I am looking for a complete list of parameters that I can pass in the
> "connect"/"open database connection" list on the client (in this case,
> github.com/lib/pq).
>
> The list of parameters documented here:
> https://www.postgresql.org/docs/11/libpq-connect.html#LIBPQ-PARAMKEYWORDS
> does not include the "timezone" parameter. However, github.com/lib/pq seems
> to indicate that "timezone" is an acceptable parameter, for example, here:
> https://github.com/lib/pq/blob/master/encode_test.go#L123

The documentation you're looking at on postgresql.org is for the libpq
C driver (which is written and maintained as part of core PostgreSQL),
not for the Go driver that's at github.com/lib/pq.

For my part, it doesn't seem like a good idea for the Go driver to
deviate in this way, but you'd have to talk to the author of it about
that, not us.  Then again, that git repo also says at the bottom that
it's not actively being developed and recommends a different Go driver
be used.

> Elsewhere in the docs, the PGTZ environment variable can be used to set the
> timezone on the client.

This is true, for the libpq driver.  I don't know about the Go driver.

> I would expect to see "timezone" (and anything else that can be configured)
> in that list.

'timezone' isn't accepted by libpq, which is what our documentation is
referring to.

Thanks,

Stephen

Re: Client parameter list omits timezone

From
Stephen Frost
Date:
Greetings,

Please don't top-post on these lists.

* Kevin Burke (kevin@meter.com) wrote:
> I guess my broader issue is that it's hard to figure out how to configure
> things like the timezone in a given client. Generally, you pass some things
> as parameters in the connection string but it's not obvious which values
> are accepted or where to pass them, unless you go rooting around in the
> protocol details and the source code of the client, which is more than most
> users will or should be asked to do.

As I said in my previous reply, you need to discuss that with the
maintainer of that driver.  The documentation you found does,
accurately, reflect what options can be passed for the driver that it is
the documentation for- namely the libpq C driver.

Thanks,

Stephen

Attachment