Re: Storage sizes for dates/times (documentation bug?)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Marc Munro <marc(at)bloodnok(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Storage sizes for dates/times (documentation bug?)
Date: 2008-04-15 01:10:52
Message-ID: 26079.1208221852@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Marc Munro <marc(at)bloodnok(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2008-04-15 01:27:30 Re: Storage sizes for dates/times (documentation bug?)
Previous Message Marc Munro 2008-04-14 22:12:52 Storage sizes for dates/times (documentation bug?)