pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gavin Flower <GavinFlower@archidevsys.co.nz>
To: pgsql-general@lists.postgresql.org
Subject: Re: Timestamp with vs without time zone.
Date: Wed, 22 Sep 2021 21:52:36 +1200
Message-ID: <e91166c4-fb7a-d126-e91b-1bf1b38c219a@archidevsys.co.nz> (raw)
In-Reply-To: <CAGuHJrPX1wq16w4mGkWE5XEcv5Qay8r1tNTdiBsiGRJB4AKP2A@mail.gmail.com>
References: <CAGuHJrPKdrXGAFkzE4tXd3b5uKe47WCRdV3LNrYi_HBjYYa+OA@mail.gmail.com>
	<ae03895fc4ba57bce2195919aad40899c7d484b7.camel@cybertec.at>
	<CAGuHJrNeP8H-J9LD-pwO5gaNhSSKSgfn=oBKrH5-ifyoy+WgrA@mail.gmail.com>
	<trinity-8442e59f-d55e-42a5-8699-47be32a9b347-1632209999042@3c-app-gmx-bap35>
	<YUmbZHqaq+NGLC1B@hjp.at>
	<CAGuHJrOVrgpxazJqKxyHsu99T9KCBmp+Zh-=9jHsdCy++W50JQ@mail.gmail.com>
	<YUoUSiOJDKAijVoE@hjp.at>
	<CADK3HHLtfoTC9W5v19uE9qzNT7vPvhkDeqbuhm66nTurfmyv4Q@mail.gmail.com>
	<72C6EDD6-39E3-47A9-B313-A4D6C7AF0C44@fairwindsoft.com>
	<875yutl6l8.fsf@gmail.com>
	<CAGuHJrPX1wq16w4mGkWE5XEcv5Qay8r1tNTdiBsiGRJB4AKP2A@mail.gmail.com>

On 22/09/21 20:11, Tim Uckun wrote:
> I'll add another layer of complication.
>
> You have a database server hosted in Australia, and that's also where
> your web server and api server is. You have customers all over the
> world though so you set up additional API servers in Europe, USA,
> Japan etc.
>
> A korean user will fetch you single page app as static HTML from S3
> with cloudfront. It will hit your japanese API server,  which will
> fetch the data from your japanese read only replica with the master
> being in Australia.
>
> The master DB  writes the records has to know your end user is in
> Korea somehow so you have to carry that time zone all the way across
> those tiers.
>
> To me the ideal solution would be to have a compound object which has
> the time zone in it. This object gets passed through the tiers and end
> up at the database where it's stored.
>
[...]

Please don't top post!  Bottom post like I am.

I imagine the compound object, call it timestamporigin (timestampo?)) 
would have 2 components:

 1. GMT time
 2. Offset hours & minutes
 3. client time zone code

This was means:

 1. you could calculate accurate time differences even between 2
    timestampo's regardless of which time zone they came from
 2. you know the correct local time it was made
 3. you know the time zone it came from
 4. it would still be correct even if the machine's, or the server's,
    time zone file was updated and the changes applied retroactively.


Cheers,
Gavin






view thread (35+ messages)  latest in thread

Message-ID: <e91166c4-fb7a-d126-e91b-1bf1b38c219a@archidevsys.co.nz>
Permalink:  ../e91166c4-fb7a-d126-e91b-1bf1b38c219a@archidevsys.co.nz/
Also on:    postgresql.org/message-id/e91166c4-fb7a-d126-e91b-1bf1b38c219a@archidevsys.co.nz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: GavinFlower@archidevsys.co.nz
  Subject: Re: Timestamp with vs without time zone.
  In-Reply-To: <e91166c4-fb7a-d126-e91b-1bf1b38c219a@archidevsys.co.nz>
  References: <CAGuHJrPKdrXGAFkzE4tXd3b5uKe47WCRdV3LNrYi_HBjYYa+OA@mail.gmail.com> <ae03895fc4ba57bce2195919aad40899c7d484b7.camel@cybertec.at> <CAGuHJrNeP8H-J9LD-pwO5gaNhSSKSgfn=oBKrH5-ifyoy+WgrA@mail.gmail.com> <trinity-8442e59f-d55e-42a5-8699-47be32a9b347-1632209999042@3c-app-gmx-bap35> <YUmbZHqaq+NGLC1B@hjp.at> <CAGuHJrOVrgpxazJqKxyHsu99T9KCBmp+Zh-=9jHsdCy++W50JQ@mail.gmail.com> <YUoUSiOJDKAijVoE@hjp.at> <CADK3HHLtfoTC9W5v19uE9qzNT7vPvhkDeqbuhm66nTurfmyv4Q@mail.gmail.com> <72C6EDD6-39E3-47A9-B313-A4D6C7AF0C44@fairwindsoft.com> <875yutl6l8.fsf@gmail.com> <CAGuHJrPX1wq16w4mGkWE5XEcv5Qay8r1tNTdiBsiGRJB4AKP2A@mail.gmail.com> <e91166c4-fb7a-d126-e91b-1bf1b38c219a@archidevsys.co.nz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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