How Does Postgres Store Time Zones

PostgreSQL doesn’t store the time zone they come from with your timestamp. Instead it converts to and from the input and output timezone much like we’ve seen for text with client_encoding.

How are timestamps stored in PostgreSQL?

PostgreSQL stores the timestamptz in UTC value. When you insert a value into a timestamptz column, PostgreSQL converts the timestamptz value into a UTC value and stores the UTC value in the table.

How does SQL store time zones?

  1. Simply store the IANA identifier as a string along with each location.
  2. Store all IANA identifiers in a separate table and use a foreign key to link to it.
Alexander Ross

Alexander Ross

Gaming, Esports & Interactive Media Writer

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.

Share this article
Twitter Facebook Pinterest