Itagaki Takahiro <itagaki.takah...@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

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to