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

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: proposal: a width specification for s specifier (format function), fix behave when positional and ordered placeholders are used
Date: 2013-01-29 08:45:29
Message-ID: CAEZATCWeVkuEqUZLQBOsfLyrDxJtp9QPO5KPV_ivUqH-1unA1w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 29 January 2013 08:19, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> wrote:
> * The width field is optional, even if the '-' flag is specified. So
> '%-s' is perfectly legal and should be interpreted as '%s'. The
> current implementation treats it as a width of 0, which is wrong.
>

Oh, but of course a width of 0 is the same as no width at all, so the
current code is correct after all. That's what happens if I try to
write emails before I've had my caffeine :-)

I think my other points remain valid though. It would still be neater
to parse the flags separately from the width field, and then all
literal numbers that appear in the format should be positive.

Regards,
Dean

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2013-01-29 08:45:42 Re: Patches for TODO item: Avoid truncating empty OCDR temp tables on COMMIT
Previous Message Dean Rasheed 2013-01-29 08:19:39 Re: Re: proposal: a width specification for s specifier (format function), fix behave when positional and ordered placeholders are used