Re: RfD: more powerful "any" types

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Aidan Van Dyk <aidan(at)highrise(dot)ca>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Hannu Krosing <hannu(at)2ndquadrant(dot)com>, "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 14:38:04
Message-ID: 20209.1252679884@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> 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 disadvantage I can see of that is that it would lose precision
for NUMERIC. I'd really like to be able to write "%300.100f" and have it
Do The Right Thing with a 300-digit numeric input.

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

Yeah, that's a bit of a pain too. But we have the logic for that in
src/port/. It wouldn't be that much work to repurpose it. Actually,
since a SQL implementation wouldn't be constrained to read the actual
arguments left-to-right, you could probably simplify it a great deal.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-09-11 14:40:30 Re: community decision-making & 8.5
Previous Message Tom Lane 2009-09-11 14:30:42 Re: RfD: more powerful "any" types