public inbox for [email protected]  
help / color / mirror / Atom feed
Sybase to postgres Timestamp column
5+ messages / 4 participants
[nested] [flat]

* Sybase to postgres Timestamp column
@ 2026-01-21 13:53 SASIKUMAR Devaraj <[email protected]>
  2026-01-21 14:25 ` Re: Sybase to postgres Timestamp column Erik Wienhold <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: SASIKUMAR Devaraj @ 2026-01-21 13:53 UTC (permalink / raw)
  To: [email protected]

Hi All
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
Please advise any workaround is there?
RegardsSasi


Sent from Yahoo Mail for iPhone


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Sybase to postgres Timestamp column
  2026-01-21 13:53 Sybase to postgres Timestamp column SASIKUMAR Devaraj <[email protected]>
@ 2026-01-21 14:25 ` Erik Wienhold <[email protected]>
  2026-01-21 15:06   ` Re: Sybase to postgres Timestamp column Tom Lane <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: Erik Wienhold @ 2026-01-21 14:25 UTC (permalink / raw)
  To: SASIKUMAR Devaraj <[email protected]>; +Cc: [email protected]

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
> Please advise any workaround is there?

I'm not familiar with Sybase.  What issues are you facing?  Please
provide more details such as database schema, error messages or expected
vs. actual results.

But Postgres should accept this timestamp format without issue:

	SELECT 'Jan 21 2026 5:35 PM'::timestamp;
	      timestamp
	---------------------
	 2026-01-21 17:35:00
	(1 row)

-- 
Erik Wienhold





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Sybase to postgres Timestamp column
  2026-01-21 13:53 Sybase to postgres Timestamp column SASIKUMAR Devaraj <[email protected]>
  2026-01-21 14:25 ` Re: Sybase to postgres Timestamp column Erik Wienhold <[email protected]>
@ 2026-01-21 15:06   ` Tom Lane <[email protected]>
  2026-01-21 16:06     ` Re: Sybase to postgres Timestamp column Thomas Carroll <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: Tom Lane @ 2026-01-21 15:06 UTC (permalink / raw)
  To: Erik Wienhold <[email protected]>; +Cc: SASIKUMAR Devaraj <[email protected]>; [email protected]

Erik Wienhold <[email protected]> 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





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Sybase to postgres Timestamp column
  2026-01-21 13:53 Sybase to postgres Timestamp column SASIKUMAR Devaraj <[email protected]>
  2026-01-21 14:25 ` Re: Sybase to postgres Timestamp column Erik Wienhold <[email protected]>
  2026-01-21 15:06   ` Re: Sybase to postgres Timestamp column Tom Lane <[email protected]>
@ 2026-01-21 16:06     ` Thomas Carroll <[email protected]>
  2026-01-29 10:09       ` Re: Sybase to postgres Timestamp column SASIKUMAR Devaraj <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: Thomas Carroll @ 2026-01-21 16:06 UTC (permalink / raw)
  To: Erik Wienhold <[email protected]>; Tom Lane <[email protected]>; +Cc: SASIKUMAR Devaraj <[email protected]>; [email protected] <[email protected]>

 A couple of things to look out 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 milliseconds (dot vs. colon).
Second: date math is different for Sybase vs. Postgres.  A difference in days in Sybase is computed by counting date thresholds crossed.  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 <[email protected]> wrote:  
 
 Erik Wienhold <[email protected]> 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


  

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Sybase to postgres Timestamp column
  2026-01-21 13:53 Sybase to postgres Timestamp column SASIKUMAR Devaraj <[email protected]>
  2026-01-21 14:25 ` Re: Sybase to postgres Timestamp column Erik Wienhold <[email protected]>
  2026-01-21 15:06   ` Re: Sybase to postgres Timestamp column Tom Lane <[email protected]>
  2026-01-21 16:06     ` Re: Sybase to postgres Timestamp column Thomas Carroll <[email protected]>
@ 2026-01-29 10:09       ` SASIKUMAR Devaraj <[email protected]>
  0 siblings, 0 replies; 5+ messages in thread

From: SASIKUMAR Devaraj @ 2026-01-29 10:09 UTC (permalink / raw)
  To: Thomas Carroll <[email protected]>; Erik Wienhold <[email protected]>; Tom Lane <[email protected]>; +Cc: [email protected] <[email protected]>

👍

^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2026-01-29 10:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-01-21 13:53 Sybase to postgres Timestamp column SASIKUMAR Devaraj <[email protected]>
2026-01-21 14:25 ` Erik Wienhold <[email protected]>
2026-01-21 15:06   ` Tom Lane <[email protected]>
2026-01-21 16:06     ` Thomas Carroll <[email protected]>
2026-01-29 10:09       ` SASIKUMAR Devaraj <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox