Skip to content

Error parsing time "America/Los_Angeles" #2060

@fuetser

Description

@fuetser

Hello, i'm trying to setup posgresql replication to doltgres and keep getting this error with timezone:

2025-11-28 13:31:48 2025/11/28 10:31:48 replicating query: INSERT INTO public.kernel (id, name, created_at, updated_at) VALUES (4, '7.7', '2025-11-28 09:59:18.706143 +0000 UTC', '2025-11-28 09:59:18.706143 +0000 UTC')
2025-11-28 13:31:48 time="2025-11-28T10:31:48Z" level=debug msg="Received message: {\"Type\":\"Query\",\"String\":\"INSERT INTO public.kernel (id, name, created_at, updated_at) VALUES (4, '7.7', '2025-11-28 09:59:18.706143 +0000 UTC', '2025-11-28 09:59:18.706143 +0000 UTC')\"}"
2025-11-28 13:31:48 time="2025-11-28T10:31:48Z" level=debug msg="Starting query" connectTime="2025-11-28 10:31:48.225503917 +0000 UTC m=+0.578122960" connectionDb=postgres connectionID=3 query="INSERT INTO public.kernel (id, name, created_at, updated_at) VALUES (4, '7.7', '2025-11-28 09:59:18.706143 +0000 UTC', '2025-11-28 09:59:18.706143 +0000 UTC')"
2025-11-28 13:31:48 time="2025-11-28T10:31:48Z" level=warning msg="error running query" connectTime="2025-11-28 10:31:48.225503917 +0000 UTC m=+0.578122960" connectionDb=postgres connectionID=3 error="parsing time \"America/Los_Angeles\" as \"Z07:00:00\": cannot parse \"America/Los_Angeles\" as \"Z07:00:00\"" query="INSERT INTO public.kernel (id, name, created_at, updated_at) VALUES (4, '7.7', '2025-11-28 09:59:18.706143 +0000 UTC', '2025-11-28 09:59:18.706143 +0000 UTC')"
2025-11-28 13:31:48 2025/11/28 10:31:48 Error: ERROR: parsing time "America/Los_Angeles" as "Z07:00:00": cannot parse "America/Los_Angeles" as "Z07:00:00" (errno 1105) (sqlstate HY000) (SQLSTATE XX000). Retrying

This also happens if i run a simple query with timestamp:

/doltgresql # psql -h localhost -U postgres -W -d postgres
Password: 
psql (16.11, server 15.0)
Type "help" for help.

postgres=> select now();
ERROR:  parsing time "America/Los_Angeles" as "Z07:00:00": cannot parse "America/Los_Angeles" as "Z07:00:00" (errno 1105) (sqlstate HY000)
postgres=> 

I am running doltgres version 0.53.4 inside a docker container with the following dockerfile (it would be nice to have an official image):

FROM alpine:3.19

RUN apk add --no-cache \
    bash \
    curl \
    libc6-compat \
    postgresql-client

RUN curl -L https://github.com/dolthub/doltgresql/releases/latest/download/doltgresql-linux-amd64.tar.gz -o doltgresql.tar.gz && \
    tar -xzf doltgresql.tar.gz && \
    mv doltgresql-linux-amd64/bin/doltgres /usr/local/bin/doltgres && \
    chmod +x /usr/local/bin/doltgres && \
    rm doltgresql.tar.gz

RUN mkdir -p /var/lib/doltgresql

WORKDIR /doltgresql

EXPOSE 5432

My doltgres config file:

log_level: debug

listener:
  host: 0.0.0.0
  port: 5432
  
postgres_replication:
  postgres_server_address: postgres
  postgres_user: myuser
  postgres_password: mypassword
  postgres_database: postgres
  postgres_port: 5432
  slot_name: doltgres_slot
  
behavior:
  read_only: false
  dolt_transaction_commit: true

The time zone inside the doltgres container is UTC, so I don't understand where Los Angeles comes from.

I found this issue in the dolt repository, but the proposed fix set time_zone='UTC' doesn't work wtih doltgres.
dolthub/dolt#9555

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions