-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
When pisces creates database tables, the type used for non-integer fields is real. For example, this is a table - Origin:
CREATE
TABLE IF NOT EXISTS origin
(
lat real,
lon real,
depth real,
...
The use of this data type causes problems with accuracy and with the search for events at given coordinates.
For example I have an event with coordinates lat: 41.0508 lon:79.5898. I am running a query:
SELECT * FROM origin WHERE lat=41.0508 AND lon=79.5898;
which returns nothing.
If I manually change the real data type to numeric, then I find the desired event.
Floating point variables are vulnerable to floating point errors. Therefore, if accuracy is important it's always recommended to use a numeric type.
jkmacc-LANL
Metadata
Metadata
Assignees
Labels
No labels