Re: RfD: more powerful "any" types

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: "David E(dot) Wheeler" <david(at)kineticode(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(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-10 19:10:12
Message-ID: 6639.1252609812@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
> I don't afraid about crashing. Simply I have not idea what sql
> sprintf's behave in case:

> SELECT sprintf('some %s', 10)

That one I don't think is hard --- coerce the input type to text and
print the string.

> SELECT sprintf('some %d', 10::mycustomtype)

For the formats that presume an integer or float input in C, perhaps
we could coerce to numeric (failing if that fails) and then print
appropriately. Or maybe int or float8 would be more appropriate
conversion targets.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-09-10 19:15:32 Re: RfD: more powerful "any" types
Previous Message Pavel Stehule 2009-09-10 19:06:58 Re: RfD: more powerful "any" types