Skip to content

SET TIME ZONE is not readable back under the spelling PostgreSQL pairs it with: SHOW TIME ZONE answers an empty string while SHOW timezone answers the value #8391

Closed

Description

@ruispereira

Summary

parseSetCommand() gained SET TIME ZONE <value>, PostgreSQL's SQL-standard spelling, normalizing it to the
parameter name timezone. SHOW was not given the matching normalization: queryCommand() lower-cases whatever
follows SHOW and hands it to PostgresSessionSettings.show(), which keys on "timezone" and falls through to
its default arm for "time zone". That arm answers an empty string for a name it does not know, so the two
spellings of the same parameter now disagree about a value the server really holds.

The same default arm is why the answer is an empty row rather than PostgreSQL's
ERROR: unrecognized configuration parameter (42704), which is pre-existing and larger than this; what is new is
that a SET this server now honours has a documented read-back form that reports nothing.

Where (HEAD 8b84c3d)

postgresw/src/main/java/com/arcadedb/postgres/PostgresNetworkExecutor.java:142 and the branch it drives in
parseSetCommand():

  private static final Pattern SET_TIME_ZONE = Pattern.compile("(?i)^TIME\\s+ZONE\\s+");

against the SHOW arm of queryCommand(), which does no such normalization:

      } else if (upperCaseText.startsWith("SHOW ")) {
        final String varName = query.query.substring(5).trim().toLowerCase(Locale.ENGLISH);
        resultSet = new IteratorResultSet(createResultSet(varName, getShowConfigValue(varName)).iterator());

and PostgresSessionSettings.show(), whose default arm answers "" for any name it does not know.

Repro

Simple protocol, one connection, against a server built at this HEAD (value of the single returned column shown):

SHOW timezone                    ==> UTC
SHOW TIME ZONE                   ==>                 (empty)
SET TIME ZONE 'Europe/Rome'      ==> CommandComplete SET, ParameterStatus TimeZone=Europe/Rome
SHOW timezone                    ==> Europe/Rome
SHOW TIME ZONE                   ==>                 (empty)   <- same parameter, other spelling
RESET timezone                   ==> ParameterStatus TimeZone=UTC
SHOW timezone                    ==> UTC

Suggested fix

Normalize the name in one place, next to the one parseSetCommand() already uses: fold TIME ZONE to timezone
(and, while there, SESSION AUTHORIZATION and the other multi-word spellings if they are ever accepted) before
show() is asked, so a parameter is spelled the same way whichever statement names it. The pattern that does it
for SET is right there and can be shared.

Scope / confidence

Reproduced on the wire. Refuted that SHOW TIME ZONE might be rejected earlier as unparseable (it is not: it takes
the SHOW arm, builds a one-row result set under a column literally named time zone, and answers an empty
value, which a client reads as a successful answer).


Activity

  1. added
    severity:minor
    on Sep 25, 2026
  2. added
    in progress
    on Sep 25, 2026
  3. self-assigned this
    on Sep 25, 2026
  4. added this to the 26.10.1 milestone on Sep 25, 2026
  5. added a commit that references this issue on Sep 25, 2026
  6. lvca commented on Sep 25, 2026

    @lvca
    Member

    Fixed in #8396 (26.10.1). SHOW TIME ZONE now returns the same value as SHOW timezone. RESET TIME ZONE, which was refused as malformed, now works too.


    ❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.

  7. removed
    in progress
    on Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugpostgresql-wireseverity:minor

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions