Re: RfD: more powerful "any" types

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "David E(dot) Wheeler" <david(at)kineticode(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: RfD: more powerful "any" types
Date: 2009-09-10 18:25:00
Message-ID: 162867790909101125s4a071029j29cf87d1ef61ec02@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2009/9/10 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
>>> On Sep 10, 2009, at 10:16 AM, Tom Lane wrote:
>>>> I thought the idea was to
>>>> provide the same power as sprintf, eg field width controls, numeric
>>>> formatting options, etc.
>
>> no - we have to_char function, why we need different formatting system?
>
> Why do we need this at all, when we have the concatenation operator?

what is more readable?

select 'i=' || i || ', b=' || b || ', c=' || c ..

or

select format('i=%, b=%, c=%', i, b, c ..)

> I think the point of it is that people are used to how sprintf works.
> So it should work as nearly like sprintf as possible.
>

How sprintf will be print bytea type, or char(n) type values? I can
understand, so people like some what is well known, but sprintf
function is from other domain than databases. There isn't possible
100% compatible implementation - because sprintf desn't knows arrays,
custom types, rows.

>                        regards, tom lane
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2009-09-10 18:26:38 Re: Ragged CSV import
Previous Message Robert Haas 2009-09-10 18:24:53 Re: RfD: more powerful "any" types