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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Storage sizes for dates/times (documentation bug?)
Дата
Msg-id 26079.1208221852@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Storage sizes for dates/times (documentation bug?)  (Marc Munro <marc@bloodnok.com>)
Ответы Re: Storage sizes for dates/times (documentation bug?)
Re: Storage sizes for dates/times (documentation bug?)
Список 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 по дате отправления:

Предыдущее
От: Marc Munro
Дата:
Сообщение: Storage sizes for dates/times (documentation bug?)
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Storage sizes for dates/times (documentation bug?)