Re: RfD: more powerful "any" types

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Aidan Van Dyk <aidan(at)highrise(dot)ca>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Hannu Krosing <hannu(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "David E(dot) Wheeler" <david(at)kineticode(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: RfD: more powerful "any" types
Date: 2009-09-11 03:26:50
Message-ID: 20090911032650.GM31165@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2009-09-11 03:43:50 Re: RfD: more powerful "any" types
Previous Message Robert Haas 2009-09-11 02:53:27 Re: COPY enhancements