Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x4epV-007Ipf-2z for pgsql-docs@arkaria.postgresql.org; Thu, 10 Sep 2026 13:28:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1x4epU-0061Fl-2v for pgsql-docs@arkaria.postgresql.org; Thu, 10 Sep 2026 13:28:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x4Mxt-00HCuw-35 for pgsql-docs@lists.postgresql.org; Wed, 09 Sep 2026 18:24:09 +0000 Received: from mahout.postgresql.org ([2001:4800:3e1:1::227]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1x4Mxq-00000003otg-43uv for pgsql-docs@lists.postgresql.org; Wed, 09 Sep 2026 18:24:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Message-ID:Date:Reply-To:Cc:From:To:Subject: Content-Transfer-Encoding:MIME-Version:Content-Type:Sender:Content-ID: Content-Description:In-Reply-To:References; bh=QfXhW8K0+pEJk0zbErj5PQyl4rvvf4HLihPK/WODlD8=; b=i/dLbq0nPKLVeyms+PLQFDzQBa 8mGhkGT44R+rEpb0C4fdJGyVngsOWfeXDQ2SYWwOplo18P/6AAggdvSDRPU9ONAfEEA10j7USO8DD IfEAsC6L4ZDVIMWOtk8EyaX3aCDKbQZcjOIJUjCFvRk8dJKw5OIklbvVREXx2W5YZ31+G8XmUTrgx tpXHp4vI8fwOU6U6/vqQImC2vBGQ7mBGxTLbK1mMmR9drkjjiQywJB97dkPqcW3fDUim5vmPQLzGE 0SRiPBgz7q3MT+TfO71MxoLCXiGd4MQfz3GOLcZ9r/Ou/whZ9GzvgvUU5J12AYPgUUCcG3EZucsEi /6+ft6zg==; Received: from wrigleys.postgresql.org ([2a02:16a8:dc51::60]) by mahout.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x4Mxo-00EWjX-2t for pgsql-docs@lists.postgresql.org; Wed, 09 Sep 2026 18:24:04 +0000 Received: from localhost ([127.0.0.1] helo=wrigleys.postgresql.org) by wrigleys.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1x4Mxn-00000003kEQ-2KVQ for pgsql-docs@lists.postgresql.org; Wed, 09 Sep 2026 18:24:03 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: 8.5.1. Date/Time Input To: pgsql-docs@lists.postgresql.org From: PG Doc comments form Cc: kacperkuras@hotmail.com Reply-To: kacperkuras@hotmail.com, pgsql-docs@lists.postgresql.org Date: Wed, 09 Sep 2026 18:23:24 +0000 Message-ID: <178897820483.2258529.4862563749043725162@wrigleys.postgresql.org> X-Auto-Response-Suppress: All Auto-Submitted: auto-generated List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk The following documentation comment has been logged on the website: Page: https://www.postgresql.org/docs/18/datatype-datetime.html Description: Section 8.5.1 says date/time input is accepted "in almost any reasonable format, including ISO 8601". That holds for years 0001..9999 but not outside them, and I could not find the limit stated anywhere. ISO 8601 writes years outside that range with an explicit sign and more than four digits. PostgreSQL rejects those, while holding and printing the very same values in its own spelling: SELECT '10000-01-02'::date; -- 10000-01-02 SELECT '+10000-01-02'::date; -- ERROR: time zone displacement out of range: "+10000-01-02" SELECT '-0001-01-02'::date; -- ERROR: invalid input syntax for type date: "-0001-01-02" SELECT '0000-01-02'::date; -- ERROR: date/time field value out of range: "0000-01-02" Per B.1, a token starting with + or - is read as a numeric time zone, and the first error names that directly. The negative forms fail differently - as plain syntax rather than as a displacement - so I have not assumed the same cause for them. Either way, ISO 8601 also counts through a year zero where PostgreSQL counts BC from one, so ISO -0001 (2 BC) has no ISO spelling PostgreSQL accepts. I ran into this writing a PostgreSQL driver for Kotlin: for such a year, the ISO 8601 that Kotlin's date library produces is a string PostgreSQL will not read back =E2=80=94 for a date it stores and prints happily. Suggested wording =E2=80=94 qualify the claim rather than describe the pars= er, e.g.: "...including ISO 8601 (for years 0001-9999; ISO 8601 expanded years carry an explicit sign, which is read as a time zone offset =E2=80=94 write 10000-01-02 or 0002-01-02= BC instead), SQL-compatible, traditional POSTGRES, and others."