Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Marc Munro <marc@xxxxxxxxxxxx> 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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux