Re: string function - "format" function proposal

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, 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 03:59:13
Message-ID: AANLkTi=yUAq09-uf1z19WiGtoTRstY8v=JpCXPzSm5-S@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2010/10/15 Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>:
> On Thu, Oct 14, 2010 at 9:50 PM, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
>> They're both somewhat arcane. But I think the C syntax is likely to be more
>> familiar to a wider group of users (including, for example, perl hackers)
>> than the C# syntax, and is to be preferred on those grounds alone.
>
> OK, probably C syntax is the best design.
> Then, let's merge format() and  substitute() in the latest patch.
>
> I have a comment about %i for identifier format. %i is also used in
> printf(), so it would be better to choose another character, like %I.
> (%l is ok, but would be %L if we choose %I.)
> Implementation for sprintf() in strincfunc might not be used now,
> but it will be a conflict when we also merge it to format() in the future.
>

I like to see only lower case chars for tags. Using upper chars isn't
a good idea. The system in tags must not be same as I designed, but
there should be clean relation between tag and semantic. The current
system was simple %s string, %i identifier %l literal - if you don't
like %l or %i, then maybe %ls or %is - like "literal string" or "ident
string".

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.

Regards

Pavel Stehule
> --
> Itagaki Takahiro
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Itagaki Takahiro 2010-10-15 04:55:37 Re: string function - "format" function proposal
Previous Message Robert Haas 2010-10-15 03:02:14 Re: XML schema validation