Re: [HACKERS] Odd numeric->float4/8 casting behaviour

2007-01-04 Thread Tom Lane
Gregory Stark <[EMAIL PROTECTED]> writes: > This is pre-operator-families, I thought "preferred type" was new with them. No, preferred types have been around for a very long time. regards, tom lane ---(end of broadcast)--- T

Re: [HACKERS] Odd numeric->float4/8 casting behaviour

2007-01-04 Thread Gregory Stark
"Tom Lane" <[EMAIL PROTECTED]> writes: > Gregory Stark <[EMAIL PROTECTED]> writes: >> I believe this is happening because the numeric is being cast to float8 and >> then the float4-float8 cross-data-type operator is being used. It seems like >> it would be preferable to cast it to float4 and use

Re: [HACKERS] Odd numeric->float4/8 casting behaviour

2007-01-04 Thread Tom Lane
Gregory Stark <[EMAIL PROTECTED]> writes: > I believe this is happening because the numeric is being cast to float8 and > then the float4-float8 cross-data-type operator is being used. It seems like > it would be preferable to cast it to float4 and use the non-cross-data-type > operator. They're bo

[HACKERS] Odd numeric->float4/8 casting behaviour

2007-01-04 Thread Gregory Stark
I noticed this odd discrepancy: postgres=# select -0.999::numeric(3,3)::float4 = -0.999::numeric(3,3); ?column? -- f (1 row) I believe this is happening because the numeric is being cast to float8 and then the float4-float8 cross-data-type operator is being used. It seems like it wou