Re: RfD: more powerful "any" types
От | Pavel Stehule |
---|---|
Тема | Re: RfD: more powerful "any" types |
Дата | |
Msg-id | 162867790909101235w55f4ad9p61c2a86f81e3a23@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: RfD: more powerful "any" types (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: RfD: more powerful "any" types
|
Список | pgsql-hackers |
2009/9/10 Tom Lane <tgl@sss.pgh.pa.us>: > Pavel Stehule <pavel.stehule@gmail.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. it's possible - so format tags doesn't mean data type, but it means "try to drow it as type" - etc invisible explicit casting. It could work, but it doesn't look like SQL. regards Pavel Stehule > > regards, tom lane >
В списке pgsql-hackers по дате отправления: