Re: RfD: more powerful "any" types - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: RfD: more powerful "any" types
Date
Msg-id 1252673842.3950.2.camel@hvost1700
Whole thread Raw
In response to Re: RfD: more powerful "any" types  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
On Thu, 2009-09-10 at 19:52 +0200, Pavel Stehule wrote:
> 2009/9/10 Tom Lane <tgl@sss.pgh.pa.us>:
> > Alvaro Herrera <alvherre@commandprompt.com> writes:
> >> alvherre=# select text_format('% was % at % and said % % times', 'Pavel'::text, 'here'::unknown, now(),
row('a','b','c'),'{42}'::int[]);
 
> >>                                  text_format
> >> -----------------------------------------------------------------------------
> >>  Pavel was here at 2009-09-10 13:12:09.054653-04 and said (a,b,c) {42} times
> >> (1 fila)
> >
> > Is that what's being proposed?  That pretty much sucks --- it's just
> > another way of concatenating some strings.  I thought the idea was to
> > provide the same power as sprintf, eg field width controls, numeric
> > formatting options, etc.
> >
> 
> I thing so this is enough - we can get simply message text - like
> raise notice statement. I thing so simple and clean function has more
> usability than heavy real sprintf function. We (c coders) are old
> dinosaurs - but  nobody else knows what sprintf function does.

They probably do, as at least PHP and perl have also (s)printf
functions, probably many others as well. But most likely each of them
has a slightly different syntax.

> I thing so the name only "format" is good, it's short. If you need
> some other formating, just you can use to_char function.

yes, format(...) is  generic enough that people won't expect it to
confirm to their favorite languages version of printf.

> Pavel
> 
> >                        regards, tom lane
> >

-- 
Hannu Krosing   http://www.2ndQuadrant.com
PostgreSQL Scalability and Availability   Services, Consulting and Training




pgsql-hackers by date:

Previous
From: Aidan Van Dyk
Date:
Subject: Re: RfD: more powerful "any" types
Next
From: Emmanuel Cecchet
Date:
Subject: Re: COPY enhancements