pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter J. Holzer <hjp-pgsql@hjp.at>
To: pgsql-general@lists.postgresql.org
Subject: Re: Re: Timestamp with vs without time zone.
Date: Tue, 21 Sep 2021 20:45:14 +0200
Message-ID: <YUooOlUZrmcJKHAg@hjp.at> (raw)
In-Reply-To: <CADK3HHJD2RNh7iOHEK=dCqSBM2+hPR-0iTsSuYN2x-7KzxZKwQ@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>
	<YUoY6fCbTm/AGKve@hjp.at>
	<CADK3HHJD2RNh7iOHEK=dCqSBM2+hPR-0iTsSuYN2x-7KzxZKwQ@mail.gmail.com>

On 2021-09-21 13:43:46 -0400, Dave Cramer wrote:
> 
> 
> On Tue, 21 Sept 2021 at 13:40, Peter J. Holzer <hjp-pgsql@hjp.at> wrote:
> 
>     On 2021-09-21 13:34:21 -0400, Dave Cramer wrote:
>     > On Tue, 21 Sept 2021 at 13:20, Peter J. Holzer <hjp-pgsql@hjp.at> wrote:
>     >     On 2021-09-21 20:50:44 +1200, Tim Uckun wrote:
>     >     Calling a type which doesn't include a timezone
>     >     "timestamp with timezone" is - how do I put this? - more than just
>     >     weird.
>     >
>     > I would say this is a perspective thing. It's a timestamp with a time
>     > zone from the client's perspective.
> 
>     I disagree. When I read back the value the original timezone is lost. So
>     it clearly DOESN'T store the timestamp WITH the timezone.
> 
> 
> I never said it stored the timezone.  I said that it has a timezone. 

The raison d’être of a database is to store data. If some data isn't
stored, the database doesn't have it, in my opinion.

As a different example, I can store a number with 15 decimal digits in a float4
and I can get 15 decimal digits out again:

hjp=> create table t (f float4);
CREATE TABLE
hjp=> insert into t(f) values(1.23456789012345);
INSERT 0 1
hjp=> select f::float8::numeric from t;
╔══════════════════╗
║        f         ║
╟──────────────────╢
║ 1.23456788063049 ║
╚══════════════════╝
(1 row)

But those digits aren't the same I stored. So a float4 doesn't "have" 15
decimal digits of accuracy. Not even 8, although in this specific case
the first 8 digits happen to be correct.

        hp

-- 
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (35+ messages)  latest in thread

Message-ID: <YUooOlUZrmcJKHAg@hjp.at>
Permalink:  ../YUooOlUZrmcJKHAg@hjp.at/
Also on:    postgresql.org/message-id/YUooOlUZrmcJKHAg@hjp.at

 · 

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: hjp-pgsql@hjp.at
  Subject: Re: Timestamp with vs without time zone.
  In-Reply-To: <YUooOlUZrmcJKHAg@hjp.at>
  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> <YUoY6fCbTm/AGKve@hjp.at> <CADK3HHJD2RNh7iOHEK=dCqSBM2+hPR-0iTsSuYN2x-7KzxZKwQ@mail.gmail.com> <YUooOlUZrmcJKHAg@hjp.at>

* 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