Prior to this patch, CockroachDB:
- incorrectly ignored the `extra_float_digits` client
parameter.
- improperly reported `ISO` as default value for server
status parameter and session var `DateStyle` (the pg
default is `ISO, MDY`.
- failed to report `TimeZone`, `is_superuser` and
`session_authorization` in the server status parameters.
- failed to report the correct (and client-provided) value of
`application_name` in the server status parameters.
- did not report the correct defaults in `pg_catalog.pg_settings`.
This patch corrects these various bugs by:
- keeping the client-provided parameters as session defaults, to be
picked up by RESET and pg_settings. (Prior to this patch, the
client parameters were discarded after setting up the session
initially.)
- extending the handling of session variables to support reporting
their current value during connection intiialization. This way
the server status parameter can report the session variables
that were just initialized from the client-provided defaults.
- eliminating the ad-hoc constant list of "statusServerParams"
maintained in pgwire/conn.go, which could dangerously go out of sync
with the session variable defaults without anyone noticing.
- adding the missing reports for `is_superuser` and
`session_authorization`.
Because CockroachDB now properly honors the value of
extra_float_digits provided by the client, any test that uses lib/pq
must now account for the fact that lib/pq automatically sets this
parameter to 2. The logic_test code is modified accordingly.
Because CockroachDB now properly reports the current TimeZone
parameter to the client during connection initialization, any test
that uses lib/pq must now account for the fact that lib/pq will load
that zone name into any parsed timestamp value coming from the
server. The tests that print out timestamps have been modified
accordingly.
As a side effect of this fix, it is now possible to set arbitrary
session variables in the client connection URL. This has another
benefit reported in the release notes below.
Release note (bug fix): CockroachDB now properly recognizes the value
of `extra_float_digits` provided by clients as a connection parameter.
Release note (bug fix): CockroachDB now properly recognizes two-part
values for the session variable and connection parameter `DateStyle`,
for compatibility with PostgreSQL.
Release note (bug fix): CockroachDB now reports all server status
parameters supported by PostgreSQL when setting up a session. This is
expected to improve compatibility with some drivers.
Release note (bug fix): CockroachDB now properly uses the
client-provided default values when using the RESET statement (or SET
... = DEFAULT).
Release note (bug fix): CockroachDB now properly fills the columns
`boot_val` and `reset_val` in `pg_catalog.pg_settings` for better
compatibility with PostgreSQL.
Release note (cli change): It is now possible to provide
initial/default values for any customizable session variable in the
client connection URL.
Release note (sql change): CockroachDB now supports more
customizations from PostgreSQL client drivers when initially setting
up the client connection.