Re: string function - "format" function proposal

Pavel Stehule <pavel.stehule@gmail.com>

From: Pavel Stehule <pavel.stehule@gmail.com>
To: Itagaki Takahiro <itagaki.takahiro@gmail.com>
Cc: Andrew Dunstan <andrew@dunslane.net>, Robert Haas <robertmhaas@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Alvaro Herrera <alvherre@commandprompt.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2010-10-15T11:20:58Z
Lists: pgsql-hackers
2010/10/15 Itagaki Takahiro <itagaki.takahiro@gmail.com>:
> On Fri, Oct 15, 2010 at 12:59 PM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
>> then maybe %ls or %is - like "literal string" or "ident string".
>
> Yeah, good idea!
>
>> I don't think so merging sprintf and format can be good. Sprintf is
>> too complex - so long years users don't know specification well and
>> creating some like sprintf function can be messy for users. I like to
>> see accurate sprintf function in contrib - and some else in core.
>
> I agree that full-spec sprintf is too complex, but precision and
> zero-full for numeric types are commonly used. I think someone
> will ask us "Why don't have numeric formats though we have %s?".

And the reply is - we have function to_char. I don't see any reason
why we have to have two independent formatting systems.

Pavel


>
> --
> Itagaki Takahiro
>