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

From Tom Lane
Subject Re: RfD: more powerful "any" types
Date
Msg-id 20209.1252679884@sss.pgh.pa.us
Whole thread Raw
In response to Re: RfD: more powerful "any" types  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: RfD: more powerful "any" types
List pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: RfD: more powerful "any" types
Next
From: Tom Lane
Date:
Subject: Re: community decision-making & 8.5