Subject: Question

From: "Caroline M. Paxson" <[email-masked]>
Date: Thu, 10 Jun 1993 18:00:00 -0700

You write:

  I was testing a retrieve command on a class

  Circle with x, and y cordinates as float8.
  In retrieving an object with particular x I got this 
  error message
  * retrieve (my_circle.all)\g

  Query sent to backend is "retrieve (my_circle.all)"
  - ---------------------------------------------------------
  | center_y    | center_x    | color       | radius      |
  - ---------------------------------------------------------
  | 0           | 0           | (null)      | 1           |
  - ---------------------------------------------------------
  | 0           | 0           | (null)      | 2           |
  - ---------------------------------------------------------

  Go 
  * retrieve (my_circle.all) where my_circle.center_x = 0.0 \g

  Query sent to backend is "retrieve (my_circle.all) where my_circle.center_x = 0.0 "
  NOTICE:Jun 10 19:45:18:there is no operator = for types float4 and float8
  NOTICE:Jun 10 19:45:18:You will either have to retype this query using an
  NOTICE:Jun 10 19:45:18:explicit cast, or you will have to define the operator
  WARN:Jun 10 19:45:18:= for float4 and float8 using DEFINE OPERATOR

I just tried your example and can't reproduce your problem.  If,
however, I define center_x and center_y as float4's, I get the 
problem.  The constant 0.0 in your retrieve query is converted to
a float8 type by the parser.  There is no = operator to compare
float4's and float8's.  If you look at the reference manual, you
will notice that the = functions for float4 and float8 both take
two arguments of the same type.  The error case occurs when a 
float8 is compared to a float4.

To fix your problem, simply cast the 0.0 into the type you need:

  retrieve (my_circle.all) where my_circle.center_x = 0.0::float4

Carol Paxson
[email-masked]