Re: format() with embedded to_char() formatter

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: format() with embedded to_char() formatter
Дата
Msg-id 25853.1290437748@sss.pgh.pa.us
обсуждение исходный текст
Ответ на format() with embedded to_char() formatter  (Itagaki Takahiro <itagaki.takahiro@gmail.com>)
Ответы Re: format() with embedded to_char() formatter  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Itagaki Takahiro <itagaki.takahiro@gmail.com> writes:
> I'd like to propose %{...}s syntax, where format('%{xxx}s', arg)
> is equivalent to format('%s', to_char(arg, 'xxx')). I think the
> approach is better than implement C-like formatter because we
> can reuse existing to_char() functions for the purpose.

This seems pretty gross, not least because the existing to_char
functions are so limited and broken.  I don't really want to make
format() incorporate all the brain damage in timestamp to_char, in
particular.  Also, it doesn't seem that you're really getting much
notational leverage with this proposal.  And lastly, AFAICS there
is no way to do what you suggest without some really ugly kluges
in the parser --- I think the function parsing code would have to
have special cases to make format() work like this.
        regards, tom lane


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Re: Proposed Windows-specific change: Enable crash dumps (like core files)
Следующее
От: Dimitri Fontaine
Дата:
Сообщение: Re: Extensions, this time with a patch