Skip to content

Archiver fails on timestamp without time zone partition column — unrecognized timestamp format #49

Description

@imtiazqa

Steps to Reproduce:

  1. Create a partitioned table with timestamp (no tz) partition column:

CREATE TABLE public.ntz_test (
id bigint GENERATED ALWAYS AS IDENTITY,
created_at timestamp NOT NULL,
val text,
PRIMARY KEY (id, created_at)
) PARTITION BY RANGE (created_at);

CREATE TABLE public.ntz_test_p_2026_04 PARTITION OF public.ntz_test
FOR VALUES FROM ('2026-04-01') TO ('2026-05-01');
2. Register with archiver: ./bin/archiver register --table ntz_test --period monthly --hot-period "1 month" --retention "5 years"
3. Run archiver: ./bin/archiver --config cf.yaml

Expected: Archive completes successfully.

Actual:

[ntz_test] archive cycle: ensure current partition: parse bounds for ntz_test_p_2026_04:
parse lower bound: unrecognized timestamp format: "2026-04-01 00:00:00"

Root Cause:
internal/partition/partition.go:parseTimestamp() only accepts formats with a timezone offset (+00, -07) or plain date. PostgreSQL emits timestamp without time zone bounds as 2026-04-01 00:00:00 (no offset) — not matched by any supported layout.

Fix: Add "2006-01-02 15:04:05" to the supported layouts in parseTimestamp().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions