Kevin Grittner escribió:
> Pavel Stehule <pavel.stehule@gmail.com> wrote:
>
> > what is more readable?
> >
> > select 'i=' || i || ', b=' || b || ', c=' || c ..
> >
> > or
> >
> > select format('i=%, b=%, c=%', i, b, c ..)
>
> Seriously, those are about dead even for me. The concatenation
> might have a slight edge, particularly since I have the option, if
> it gets out of hand, to do:
>
> select 'i=' || i
> || ', b=' || b
> || ', c=' || c
> ..
That barely works for me, and then only because it's a trivial example.
In real uses it's never that clear-cut, and the format version is a lot
better than the || alternative.
--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.