Proposal: per expression intervalstyle

Поиск
Список
Период
Сортировка
От Michał Wadas
Тема Proposal: per expression intervalstyle
Дата
Msg-id CAMEnU0AxdkgxOsP_b8uFy5ArxHWPHi72TuNCgv945i4qbgUv7g@mail.gmail.com
обсуждение исходный текст
Список pgsql-hackers
Problem: I have to set IntervalStyle in separate statement to convert
interval type to ISO8601 string.

This isn't well supported by ORMs or similar tools, requiring us to
set it globally (per role or per database).

Problem #2 (exotic): you can't mix two output styles in a single query.

Proposed solution: special case to_char function to accept values accepted by
SET intervalstyle to 'XYZ'

So:

SELECT to_char(INTERVAL '8 minutes', 'iso_8601')

will act similar to

SET intervalstyle TO 'iso_8601';
SELECT (INTERVAL '8 minutes')::text
RESET interval_style;



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: pg_receivewal makes a bad daemon
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: Is txid_status() actually safe? / What is 011_crash_recovery.pl testing?