Re: [PgFoundry] Unsigned Data Types [1 of 2]
От | Tom Lane |
---|---|
Тема | Re: [PgFoundry] Unsigned Data Types [1 of 2] |
Дата | |
Msg-id | 14575.1220803638@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: [PgFoundry] Unsigned Data Types [1 of 2] ("Jaime Casanova" <jcasanov@systemguards.com.ec>) |
Ответы |
Re: [PgFoundry] Unsigned Data Types [1 of 2]
|
Список | pgsql-patches |
"Jaime Casanova" <jcasanov@systemguards.com.ec> writes: > On Sun, Sep 7, 2008 at 2:41 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote: >> That obviously isn't supposed to happen. Where's it coming from >> exactly? > convert_numeric_to_scalar() in src/backend/utils/adt/selfuncs.c > the problem seems to be that we are asking for each type of numeric > and of course that doesn't know nothing about unsigned integers so its > treating it as a non-numeric. Ah. The scalarltsel/scalargtsel stuff has always been a bit bogus for cross-type comparisons; it assumes it will know both or neither of the two datatypes. So you can get away with using those functions for uint > uint (although they won't be very bright about it); but using them for uint > int fails outright. If you read the comments around that stuff it leaves quite a lot to be desired, but I don't really have better ideas at the moment. The best near-term solution for the uint module is probably not to rely on scalarltsel/scalargtsel for uint comparisons, but to make its own selectivity functions that know the uint types plus whatever standard types you want to have comparisons with. regards, tom lane
В списке pgsql-patches по дате отправления: