Skip site navigation (1) Skip section navigation (2)

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: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: string function - "format" function proposal
Date: 2010-09-06 06:37:18
Message-ID: AANLkTikixvPgPUsTLmwEuye3PkztYUJ97hog41bhOGV0@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
2010/9/6 Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>:
> On Wed, Sep 1, 2010 at 1:29 PM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> wrote:
>>> * %v also doesn't quote boolean values, but t and f are not valid.
>>>  You should use true and false (or 't' and 'f') for the cases.
>>
>> you have a true - it should be fixed
>
> I found quote_literal() prints boolean values as 'true' or 'false'.
> It uses casting to text type rather than calling output function.
> OTOH, format functions (and concat funcs) use output functions.
>
> Which should we use for such purposes? Consistent behavior is
> obviously preferred. Boolean type might be the only type that
> is converted to different representation in typoutput or cast-to-test,
> but we should consider to have boolean-specific hardwired code,
> or cast all types to text instead of output functions.

Personally I prefer casting to text - it allows some later
customizations. And it's more consistent with || operator. So the
functions concat* should to be fixed.

Regards

Pavel

>
> --
> Itagaki Takahiro
>

In response to

Responses

pgsql-hackers by date

Next:From: Pavel StehuleDate: 2010-09-06 07:07:54
Subject: Re: OT: OFF TOPIC: returning multiple result sets from a stored procedure
Previous:From: Heikki LinnakangasDate: 2010-09-06 06:33:14
Subject: Re: Interruptible sleeps (was Re: CommitFest 2009-07: Yay, Kevin! Thanks, reviewers!)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group