Re: Re: proposal: a width specification for s specifier (format function), fix behave when positional and ordered placeholders are used - Mailing list pgsql-hackers

From Dean Rasheed
Subject Re: Re: proposal: a width specification for s specifier (format function), fix behave when positional and ordered placeholders are used
Date
Msg-id CAEZATCWLtRi-Vbh5k_2fYkOAPxas0wZh6a0brOohHtVOtHiddA@mail.gmail.com
Whole thread Raw
In response to Re: Re: proposal: a width specification for s specifier (format function), fix behave when positional and ordered placeholders are used  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: Re: proposal: a width specification for s specifier (format function), fix behave when positional and ordered placeholders are used  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
> 2013/1/31 Pavel Stehule <pavel.stehule@gmail.com>:
>> I am sending rewritten code

Nice. I think this will be very useful, and it looks like it now
supports everything that printf() does for %s format specifiers, and
it's good that %I and %L behave the same. Also the code is looking
cleaner.

>> It indirect width "*" and "*n$" is supported. It needs little bit more code.
>>
>> There are a new question
>>
>> what should be result of
>>
>> format(">>%2$*1$s<<", NULL, "hello")
>>
>> ???

My first thought is that a NULL width should be treated the same as no
width at all (equivalent to width=0), rather than raising an
exception.

> minor update - fix align NULL for %L

You need to do the same for a NULL value with %s, which currently
produces an empty string regardless of the width.

The documentation also needs to be updated. I'm thinking perhaps
format() should now have its own separate sub-section in the manual,
rather than trying to cram it's docs into a single table row. I can
help with the docs if you like.

Regards,
Dean



pgsql-hackers by date:

Previous
From: Alexander Korotkov
Date:
Subject: Re: SP-GiST for ranges based on 2d-mapping and quad-tree
Next
From: Gurjeet Singh
Date:
Subject: Re: pg_prewarm