Re: Storage sizes for dates/times (documentation bug?) - Mailing list pgsql-general

From Tom Lane
Subject Re: Storage sizes for dates/times (documentation bug?)
Date
Msg-id 26079.1208221852@sss.pgh.pa.us
Whole thread Raw
In response to Storage sizes for dates/times (documentation bug?)  (Marc Munro <marc@bloodnok.com>)
Responses Re: Storage sizes for dates/times (documentation bug?)  (Alvaro Herrera <alvherre@commandprompt.com>)
Re: Storage sizes for dates/times (documentation bug?)  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
List pgsql-general
Marc Munro <marc@bloodnok.com> writes:
> According to the docs, timestamp with time zone takes less space than
> time with time zone with the same resolution.  Is this a documentation
> bug?

Nope.

regression=# select typname,typlen from pg_type where typname like 'time%tz';
   typname   | typlen
-------------+--------
 timestamptz |      8
 timetz      |     12
(2 rows)

> It makes no sense to me that by storing the date with the time you
> can save 4 bytes.

Actually, your mistake is in imagining that timestamptz represents the
timezone explicitly ... it doesn't.  If it did, it'd be at least as
large as timetz.

            regards, tom lane

pgsql-general by date:

Previous
From: Marc Munro
Date:
Subject: Storage sizes for dates/times (documentation bug?)
Next
From: Alvaro Herrera
Date:
Subject: Re: Storage sizes for dates/times (documentation bug?)