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

From Alvaro Herrera
Subject Re: RfD: more powerful "any" types
Date
Msg-id 20090911132327.GA5125@alvh.no-ip.org
Whole thread Raw
In response to Re: RfD: more powerful "any" types  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Responses Re: RfD: more powerful "any" types
List pgsql-hackers
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.


pgsql-hackers by date:

Previous
From: Emmanuel Cecchet
Date:
Subject: Re: COPY enhancements
Next
From: Joshua Tolley
Date:
Subject: autovacuum_max_workers docs