pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
(no subject)
2+ messages / 2 participants
[nested] [flat]

* (no subject)
@ 2017-11-03 14:35 K. Brannen <kbrannen@pwhome.com>
  2017-11-04 02:28 ` Re: Rhhh Lin <ruanlinehan@hotmail.com>
  0 siblings, 1 reply; 2+ messages in thread

From: K. Brannen @ 2017-11-03 14:35 UTC (permalink / raw)
  To: pgsql-general

Rhhh Lin <ruanlinehan@hotmail.com> wrote:

> *Also, as a sidenote - can someone please expand on why one (I was not involved in the creation of this DB/schema definition) would choose to have the definition of the timestamp column as a bigint in this case?

Because the time value you need to hold exceeds 32 bits. :)

Based on your example, you're storing epoch in milliseconds, which exceeds 2^32, so you have to use bigint. Check out the size of the int and bigint data types in the docs.

HTH,
Kevin


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



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

* Re:
  2017-11-03 14:35 (no subject) K. Brannen <kbrannen@pwhome.com>
@ 2017-11-04 02:28 ` Rhhh Lin <ruanlinehan@hotmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Rhhh Lin @ 2017-11-04 02:28 UTC (permalink / raw)
  To: K. Brannen <kbrannen@pwhome.com>; pgsql-general

Thanks for the explanation Kevin!

Regards,

Ruan


________________________________
From: pgsql-general-owner@postgresql.org <pgsql-general-owner@postgresql.org> on behalf of K. Brannen <kbrannen@pwhome.com>
Sent: 03 November 2017 14:35
To: pgsql-general@postgresql.org
Subject: [GENERAL]

Rhhh Lin <ruanlinehan@hotmail.com> wrote:

> *Also, as a sidenote - can someone please expand on why one (I was not involved in the creation of this DB/schema definition) would choose to have the definition of the timestamp column as a bigint in this case?

Because the time value you need to hold exceeds 32 bits. :)

Based on your example, you're storing epoch in milliseconds, which exceeds 2^32, so you have to use bigint. Check out the size of the int and bigint data types in the docs.

HTH,
Kevin


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

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


end of thread, other threads:[~2017-11-04 02:28 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-11-03 14:35  K. Brannen <kbrannen@pwhome.com>
2017-11-04 02:28 ` Re: Rhhh Lin <ruanlinehan@hotmail.com>

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