Trouble with float4 after upgrading from 6.5.3 to 7.0.2

From: "Romanenko Mikhail" <mikhail(at)angg(dot)ru>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Trouble with float4 after upgrading from 6.5.3 to 7.0.2
Date: 2000-08-07 11:04:27
Message-ID: 006601c0005f$40dea4c0$01011aac@angg.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

After trying to upgrade PostgreSQL from 6.5.3 to 7.0.2 I got into trouble with float4. I'll try to explain it by example.

postgres(at)lee: ~$ createdb -E LATIN1 -e testfloat
CREATE DATABASE "testfloat" WITH ENCODING = 'LATIN1'
CREATE DATABASE
postgres(at)lee: ~$ psql testfloat
testfloat=# create table tftbl (f1 float4, f2 float4);
CREATE
testfloat=# insert into tftbl values (10, 20);
INSERT 212682 1
testfloat=# select * from tftbl;
f1 | f2
----+----
10 | 20
(1 row)

testfloat=# update tftbl set f1=10.1 where f1=10 and f2=20;
UPDATE 1
testfloat=# update tftbl set f2=20.2 where f1=10.1 and f2=20;
UPDATE 0
testfloat=# select * from tftbl;
f1 | f2
------+----
10.1 | 20
(1 row)

testfloat=# update tftbl set f2=20.2 where f1=float4(10.1) and f2=20;
UPDATE 1
testfloat=# select * from tftbl;
f1 | f2
------+------
10.1 | 20.2
(1 row)

In my real client application (Windows 98, Borland C++ Builder 5.0, BDE 5.1.1.1, PostODBC 06.50.0000) I cannot in all cases use expressions like f1=float4(10.1) instead of simple f1=10.1 because BDE and PostODBC construct queries by themselves when I, for example, update tables from BCB components (BDE complains, that another user changed the record, while I am the only user at the time). They use f1=10.1-like format. With PostgeSQL 6.5.3 I have no problem of the kind.

PostgreSQL lives in Debian Linux (woody), kernel 2.2.14, libc6 2.1.3, locales 2.1.3, here is output of locale:
lee:~# locale
LANG=C
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=

Any help, tip or hint would be appreciated.

Thank you, Mikhail.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Simon Brooke 2000-08-07 11:35:56 Auto-increment datatypes and JDBC
Previous Message Vince Vielhaber 2000-08-07 10:42:57 Re:

Browse pgsql-hackers by date

  From Date Subject
Next Message Zeugswetter Andreas SB 2000-08-07 13:23:11 AW: Questionable coding in proc.c & lock.c
Previous Message Larry Rosenman 2000-08-07 10:25:57 Re: mac.c