pgsql: Remove internal uses of CTimeZone/HasCTZSet.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Remove internal uses of CTimeZone/HasCTZSet.
Дата
Msg-id E1VcHwc-0007xP-W8@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Remove internal uses of CTimeZone/HasCTZSet.

The only remaining places where we actually look at CTimeZone/HasCTZSet
are abstime2tm() and timestamp2tm().  Now that session_timezone is always
valid, we can remove these special cases.  The caller-visible impact of
this is that these functions now always return a valid zone abbreviation
if requested, whereas before they'd return a NULL pointer if a brute-force
timezone was in use.  In the existing code, the only place I can find that
changes behavior is to_char(), whose TZ format code will now print
something useful rather than nothing for such zones.  (In the places where
the returned zone abbreviation is passed to EncodeDateTime, the lack of
visible change is because we've chosen the abbreviation used for these
zones to match what EncodeTimezone would have printed.)

It's likely that there is now a fair amount of removable dead code around
the call sites, namely anything that's meant to cope with getting a NULL
timezone abbreviation, but I've not made an effort to root that out.

This could be back-patched if we decide we'd like to fix to_char()'s
behavior in the back branches, but there doesn't seem to be much
enthusiasm for that at present.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/1c8a7f617fd1d38cb0540266e4fca6835f61005a

Modified Files
--------------
src/backend/utils/adt/nabstime.c       |   26 +---------------------
src/backend/utils/adt/timestamp.c      |   37 +++++---------------------------
src/test/regress/expected/horology.out |    6 +++---
3 files changed, 9 insertions(+), 60 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix some odd behaviors when using a SQL-style simple GMT offset
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Remove CTimeZone/HasCTZSet, root and branch.