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 1viak9-00Aa0H-05 for pgsql-admin@arkaria.postgresql.org; Wed, 21 Jan 2026 16:07: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 1viak7-0082hk-0B for pgsql-admin@arkaria.postgresql.org; Wed, 21 Jan 2026 16:07:39 +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 1viak6-0082hc-14 for pgsql-admin@lists.postgresql.org; Wed, 21 Jan 2026 16:07:39 +0000 Received: from sonic318-26.consmr.mail.bf2.yahoo.com ([74.6.135.81]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1viak3-001kA3-2D for pgsql-admin@lists.postgresql.org; Wed, 21 Jan 2026 16:07:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1769011652; bh=ZPRnLG7Zpr9TY/kxStHCL5L81Vwo06uHjpPJPYw9K9M=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From:Subject:Reply-To; b=n3EZ2m7E6TBRN7wsRE6otWicUe41FoNLI40WlZL3rI84MS1CTLd88wAgW5HxWVlyAgT7ycAor0m6JzZPQKfm0u+xrX8/R1OuAy9wrrxbFFfIbJpwOIN62HL02f1Y/y137i/BFOrfYkF4f6SQHuemvUwV+cSqPzAwsf2tq1fnWIwjBwI5195ekd9R+gK+/0T6D/IW7/5jeRLnsvTimvUFjwvuex9WMt5/wdqYB5fY4vJWYsAqJslMNR4E27FdPpVunCxP7rmE4xab2Vwxb5xhy9at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n0T 8yb_xIytYkhN.8MEUqq1ybxhk3n3BcJt.yBYQR5zWbJVOqNh2xXPjwrifaHVNKsFPeksNQpTDAh_ y5PWnOkoeokdopi5bWVmqDM1klfG7dV44ume1h7V1BVmB1V8jTlwWdY0j1zIYX6Ab.daDi02WZiD msSeU8DDkLAiH_Olpk53glnaWxy7lxOUDPwCKj56JHqINj_QAIyIykojtc2xVgRMcjXdfTw5bmd6 8XxU9k0SytgXHHPihIxuL9VvYOvOG3qxqA60k9qWGq8LoxeQwlaGAdZ0VcRxPOGWSG2Iv7yeg8_A Egng224QJipe1whN8cJWruJwjVBRqib5mpq.XClR77AHGC7qnnUKUO4KQDap9R2.R3vnxGyqBoCO uUUM0taX0kVeDigVI51ySBDNsiS7VZYPXYpu6bquUhbjJ5JumU6pIO0DP5J7Svi4T_QDNWJmb_Bq Zu9Jz8QpEyLCiLfPWmjITfRhvCEd2oYxZvsnuRB.slVd_acmixXcS4A2kiJOS.AaEAkZIzDW0uaf w_EpzOmCfVgy.Hv90qKhMi_HAT0EnMp5L4ZIwUOFmeeZgA6iY8WVPZbKrvM8UbOnFkSk9e_C2qsi gV.KRSYX8K8A42qirVJ.HewVtQi5EG3ibdYkVhKKBT2ECVG4y0ahlQxpfwOdittMirGO0RDHd8br i0SlJUOnHRsd0r7Vx18NRFBoS.xEKc49IM2Yzf4MhmYRAY83T1RVULAj0pB64hqqjzwUapeBfIcm gQ.kB X-Sonic-MF: X-Sonic-ID: 732c6825-5be9-41d8-bd93-7a62e9188467 Received: from sonic.gate.mail.ne1.yahoo.com by sonic318.consmr.mail.bf2.yahoo.com with HTTP; Wed, 21 Jan 2026 16:07:32 +0000 Date: Wed, 21 Jan 2026 16:06:58 +0000 (UTC) From: Thomas Carroll To: Erik Wienhold , Tom Lane Cc: SASIKUMAR Devaraj , "pgsql-admin@lists.postgresql.org" Message-ID: <1473772846.1590447.1769011618201@mail.yahoo.com> In-Reply-To: <2193943.1769007995@sss.pgh.pa.us> References: <1903154046.1708912.1769003607609.ref@mail.yahoo.com> <1903154046.1708912.1769003607609@mail.yahoo.com> <2193943.1769007995@sss.pgh.pa.us> Subject: Re: Sybase to postgres Timestamp column MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1590446_1250658125.1769011618200" X-Mailer: WebService/1.1.24987 YMailNorrin Content-Length: 5573 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ------=_Part_1590446_1250658125.1769011618200 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable A couple of things to look out for in terms of dates that I have come acro= ss.=C2=A0 First, date formats: Aug 20 2004=C2=A0 4:23:07.786PM -- Postgres Aug 20 2004=C2=A0 4:23:07:786PM -- Sybase Note the separator difference between seconds and milliseconds (dot vs. col= on). Second: date math is different for Sybase vs. Postgres.=C2=A0 A difference = in days in Sybase is computed by counting date thresholds crossed.=C2=A0 If= I recall, Postgres counts 24 hour periods crossed. Hope this helps. Tom Carroll On Wednesday, January 21, 2026 at 10:07:00 AM EST, Tom Lane wrote: =20 =20 Erik Wienhold writes: > On 2026-01-21 14:53 +0100, SASIKUMAR Devaraj wrote: >> When we are migrating from sybase to postgres, we are facing issues >> with Timestamp field format and not matching. >> Sybase format: Jan 21 2026 5:35 PM > I'm not familiar with Sybase.=C2=A0 What issues are you facing? > But Postgres should accept this timestamp format without issue: Yeah, I don't see a difficulty on the input side, so I'm guessing the OP is wishing Postgres would output timestamps in that format. Sorry, none of the built-in datestyle settings quite match that. It's easy to replicate pretty closely using to_char(): postgres=3D# select to_char('Jan 21 2026 5:35 PM'::timestamp, 'Mon DD YYYY = HH:MI PM'); =C2=A0 =C2=A0 =C2=A0 to_char=C2=A0 =C2=A0 =C2=A0 =C2=A0=20 ---------------------- Jan 21 2026 05:35 PM (1 row) But wrapping all your timestamp output columns in to_char() might be more trouble than fixing the client-side code to accept ISO format. =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 regards, tom lane =20 ------=_Part_1590446_1250658125.1769011618200 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
A couple of things to look o= ut for in terms of dates that I have come across.  First, date formats= :

Aug 20 2004  4:23:07.786PM -- Postgres
Aug= 20 2004  4:23:07:786PM -- Sybase

Note the separator difference between seconds and millise= conds (dot vs. colon).

Second: date math is different for= Sybase vs. Postgres.  A difference in days in Sybase is computed by c= ounting date thresholds crossed.  If I recall, Postgres counts 24 hour= periods crossed.

Hope this helps.

Tom = Carroll

=20
=20
On Wednesday, January 21, 2026 at 10:07:00 AM EST, = Tom Lane <tgl@sss.pgh.pa.us> wrote:


=20 =20
Erik Wienhold <ewie@ewie.n= ame> writes:
> On 2026-01-21 14:53 +0100, SASIK= UMAR Devaraj wrote:
>> When we are migrating from s= ybase to postgres, we are facing issues
>> with Tim= estamp field format and not matching.
>> Sybase for= mat: Jan 21 2026 5:35 PM

> I'm not = familiar with Sybase.  What issues are you facing?
&= gt; But Postgres should accept this timestamp format without issue:

Yeah, I don't see a difficulty on the input s= ide, so I'm guessing
the OP is wishing Postgres would out= put timestamps in that format.
Sorry, none of the built-i= n datestyle settings quite match that.
It's easy to repli= cate pretty closely using to_char():

p= ostgres=3D# select to_char('Jan 21 2026 5:35 PM'::timestamp, 'Mon DD YYYY H= H:MI PM');
      to_char    &nb= sp;  
----------------------
Jan= 21 2026 05:35 PM

(1 row)


But wrapping a= ll your timestamp output columns in to_char() might be
mo= re trouble than fixing the client-side code to accept ISO format.

         &n= bsp;  regards, tom lane
=


------=_Part_1590446_1250658125.1769011618200--