Is this a bug in 7.0.2?

Started by Steven Vajdicabout 25 years ago3 messagesgeneral
Jump to latest
#1Steven Vajdic
svajdic@asc.corp.mot.com

Dear all,

I've migrated from RedHat6.2/PHP3.0/PostgreSQL6.5 to
Mandrake/PHP4.0/Postgres7.0.2 successfully as far as
pg_dump database_name is concerned.

I am still running BOTH versions on two computers.

PostgreSQL6.5 does not produce any error using math function "integer
(float_expression)"
(even "int(float_expression" is OK with 6.5)
and 7.0.2 complains saying:

"function integer(float8) is not found for specified types"

The query is used in something like this:

SELECT
attr-1,
attr-2,

...

attr-k,
integer(attr-2 * $php_variable_1 + atrr-3 * $php_variable_2) AS attr-N

FROM
table_1, table_2
WHERE
clause_1 AND
clause_2
ORDER BY
attr-2, attr-4

If I made an error HERE with the sintax, I apologise - I am not close to

my both Linux machines,
and sintax is OK in my real SELECT queries.

"$php_xxx"s are PHP variables and "attr-xxx"s are SQL table attributes.
The "integer(float_expression)"
is more complicated then written above BUT it all DOES work in 6.5 and
DOES NOT in 7.0.2.

Any ideas, please?

Much obliged,

Steven.

--
***********************************************

Steven Vajdic (BSc/Hon, MSc)
Senior Software Engineer
Motorola Australia Software Centre (MASC)
2 Second Avenue, Technology Park
Adelaide, South Australia 5095
email: Steven.Vajdic@motorola.com
email: svajdic@asc.corp.mot.com
Ph.: +61-8-8168-3435
Fax: +61-8-8168-3501
Front Office (Ph): +61-8-8168-3500

----------------------------------------
mobile: +61 (0)419 860 903
AFTER WORK email: steven_vajdic@ivillage.com
----------------------------------------

***********************************************

#2Einar Karttunen
ekarttun@cs.Helsinki.FI
In reply to: Steven Vajdic (#1)
Re: Is this a bug in 7.0.2?

On Wed, 4 Apr 2001, Steven Vajdic wrote:

Dear all,

I've migrated from RedHat6.2/PHP3.0/PostgreSQL6.5 to
Mandrake/PHP4.0/Postgres7.0.2 successfully as far as
pg_dump database_name is concerned.

I am still running BOTH versions on two computers.

PostgreSQL6.5 does not produce any error using math function "integer
(float_expression)"
(even "int(float_expression" is OK with 6.5)
and 7.0.2 complains saying:

"function integer(float8) is not found for specified types"

Try using int2()/int4()/int8() instead of integer(). The intn() functions
convert the float to a integer n bytes long, in normal cases you probably
want to use int4().

- Einar

#3Steven Vajdic
svajdic@asc.corp.mot.com
In reply to: Einar Karttunen (#2)
Re: Is this a bug in 7.0.2?

Einar Karttunen wrote:

integer (float_expression) or int (float_expression) DO work on

RedHat6.2/PostgreSQL6.5 and DO NOT work on Mandrake/PostgreSQL7.0.2

Try using int2()/int4()/int8() instead of integer(). The intn() functions
convert the float to a integer n bytes long, in normal cases you probably
want to use int4().

Einar,

Much obliged.

int4() has done a job.

Why is that NOT documented under "Matematical functions"?

Regards,

Steven.

--
***********************************************

Steven Vajdic (BSc/Hon, MSc)
Senior Software Engineer
Motorola Australia Software Centre (MASC)
2 Second Avenue, Technology Park
Adelaide, South Australia 5095
email: Steven.Vajdic@motorola.com
email: svajdic@asc.corp.mot.com
Ph.: +61-8-8168-3435
Fax: +61-8-8168-3501
Front Office (Ph): +61-8-8168-3500

----------------------------------------
mobile: +61 (0)419 860 903
AFTER WORK email: steven_vajdic@ivillage.com
----------------------------------------

***********************************************