Re: string function - "format" function proposal

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: string function - "format" function proposal
Date: 2010-10-15 13:30:40
Message-ID: AANLkTikMeDa8xWStP+bP08XassX7c_hS5PeG3vHT91_h@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Oct 15, 2010 at 12:55 AM, Itagaki Takahiro
<itagaki(dot)takahiro(at)gmail(dot)com> wrote:
> On Fri, Oct 15, 2010 at 12:59 PM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> wrote:
>> then maybe %ls or %is - like "literal string" or "ident string".
>
> Yeah, good idea!

-1 from me. What does this do except make it more long-winded?

>> 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?".

I think someone might also ask - why are you bothering to create this
at all? The amount of work that has been put into this is, IMHO, far
out of proportion to the value of the feature. As Pavel points out,
we already have perfectly good mechanisms for converting our various
data types to text. We do not need to invent new ones.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Treat 2010-10-15 13:41:19 docs on contrib modules that can't pg_upgrade?
Previous Message David Boreham 2010-10-15 13:30:39 Re: [GENERAL] pg_filedump binary for CentOS