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

From Alvaro Herrera
Subject Re: RfD: more powerful "any" types
Date
Msg-id 20090911032650.GM31165@alvh.no-ip.org
Whole thread Raw
In response to Re: RfD: more powerful "any" types  (Aidan Van Dyk <aidan@highrise.ca>)
Responses Re: RfD: more powerful "any" types
Re: RfD: more powerful "any" types
Re: RfD: more powerful "any" types
List pgsql-hackers
Aidan Van Dyk escribió:

> Just to make the task that much harder, if PostgreSQL is going to have a
> sprintf (in core, or contrib), I *really* hope it's a real sprintf,
> supporting everything, like:
>    $m positional notation
>    * width argument
>    All the flags [#0- +'] (I as a bonus)
>    field width . presision 
> 
> And you're going to want to make sure you support all the regular
> conversion specifiers (d/i/o/u/x/X/e/E/f/F/g/G/p/n/c/s)...

Is this really all that hard?  I'm thinking it could be implemented by
using the real C sprintf underneath, passing one % specifier and its
corresponding parameter at a time, coerced to whatever the conversion
specifier specifies.

The only thing that breaks this idea is the $n positional specifiers, I
think.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: COPY enhancements
Next
From: Pavel Stehule
Date:
Subject: Re: RfD: more powerful "any" types