BUG #2714: Wrong Result with static number - Mailing list pgsql-bugs

From Frank Schmidt
Subject BUG #2714: Wrong Result with static number
Date
Msg-id 200610240846.k9O8kOl7068702@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #2714: Wrong Result with static number  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
The following bug has been logged online:

Bug reference:      2714
Logged by:          Frank Schmidt
Email address:      schmidt@dozent.net
PostgreSQL version: 8.1.5
Operating system:   Windows
Description:        Wrong Result with static number
Details:

Follow skript works fine:

SELECT DISTINCT Artikelname, cast(BD1.Einzelpreis * (1 - Rabatt) as
decimal(8,2)) AS Preis, Rabatt
FROM Artikel A1, Bestelldetails BD1
WHERE A1.ArtikelNr = BD1.ArtikelNr
AND BD1.Einzelpreis * (1 - Rabatt) as decimal(8,2))>= ALL (SELECT
Einzelpreis * (1 - Rabatt) as decimal(8,2))
  FROM Bestelldetails);

But when I change the Statement "BD1.Einzelpreis * (1 - Rabatt) as
decimal(8,2))>= " to a static number (like 5) no result will be generated.

SELECT DISTINCT Artikelname, cast(BD1.Einzelpreis * (1 - Rabatt) as
decimal(8,2)) AS Preis, Rabatt
FROM Artikel A1, Bestelldetails BD1
WHERE A1.ArtikelNr = BD1.ArtikelNr
AND 5 >= ALL (SELECT Einzelpreis * (1 - Rabatt) as decimal(8,2))
  FROM Bestelldetails);

I can change the value to anything (real existing data), but nothing
happend.

Whats wrong?

pgsql-bugs by date:

Previous
From: "Andrus Moor"
Date:
Subject: BUG #2718: Failed to run initdb, log file does not exist
Next
From: "Sokolov Yura"
Date:
Subject: BUG #2720: plpythonu with Python 2.5 crashes