Re: Sybase to postgres Timestamp column

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Erik Wienhold <ewie(at)ewie(dot)name>
Cc: SASIKUMAR Devaraj <sashikumard(at)yahoo(dot)com>, pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Sybase to postgres Timestamp column
Date: 2026-01-21 15:06:35
Message-ID: 2193943.1769007995@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Erik Wienhold <ewie(at)ewie(dot)name> 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. 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=# select to_char('Jan 21 2026 5:35 PM'::timestamp, 'Mon DD YYYY HH:MI PM');
to_char
----------------------
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.

regards, tom lane

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2026-01-21 15:56:03 Re: Unable to compile postgresql-18.1
Previous Message Erik Wienhold 2026-01-21 14:25:59 Re: Sybase to postgres Timestamp column