Re: Reading timestamp values from Datums gives garbage values

From: Sushrut Shivaswamy <sushrut(dot)shivaswamy(at)gmail(dot)com>
To: Aleksander Alekseev <aleksander(at)timescale(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, tomas(dot)vondra(at)enterprisedb(dot)com, jcflack(at)acm(dot)org
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Reading timestamp values from Datums gives garbage values
Date: 2024-05-21 13:30:10
Message-ID: CAH5mb9-RLuE+wGDqRx-QsLJ8-15Op=Nn-f7dRRTnEHtBmwvX4A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thank you everyone for your responses.

I was a bit thrown off by the timestamp value the first time I printed it
by how small it was.
The revelation that postgres TimestampTz uses an epoch (time zero) of
2000-01-01 helped clarify
that value would indeed be smaller than regular UNIX epoch.

In my case I was trying to convert a diff of two timestamps into epoch
seconds which explains why the value
was just 1.5hr. My issue is now resolved.

Thanks again
- Sushrut

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2024-05-21 13:33:51 Re: ALTER TABLE SET ACCESS METHOD on partitioned tables
Previous Message Robert Haas 2024-05-21 12:53:06 Re: Avoid orphaned objects dependencies, take 3