Re: Correct getScale() behavior?
От | Tom Lane |
---|---|
Тема | Re: Correct getScale() behavior? |
Дата | |
Msg-id | 8545.1210378146@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: Correct getScale() behavior? (Kris Jurka <books@ejurka.com>) |
Список | pgsql-jdbc |
Kris Jurka <books@ejurka.com> writes: > On Fri, 9 May 2008, dombrd@gmail.com wrote: >> I would think it should be returning a scale and precision if the >> argument column has scale and precision specified, such as in the >> NUMERIC(7,2) example I previously showed. It seems wrong to return 0 >> in this case. >> >> I am guessing the postgresql server code would need to be changed for >> that to work though. Maybe I should be suggesting this change on a >> different list? > Right, that change would be nice, but it would require a server change. > The best place to ask about that would be -hackers. Also how do you > determine the precision of sum(numeric(7,2))? The chances of anything being done about that are not measurably different from zero. Postgres is by and large an abstract-data-type system that tries hard not to have too much knowledge about specific data types, let alone specific functions for specific data types, wired into the core server. So even assuming that you could determine the correct typmod to return (which, as Kris implies, you really cannot for this example or most others), any sort of quick-hack patch to inject the knowledge would probably be rejected. We'd want to see it formulated as a plugin API available to all datatypes and functions ... and the effort to do that, in comparison to the number of actual use cases, doesn't look very promising. regards, tom lane
В списке pgsql-jdbc по дате отправления: