I am using the postgresql jdbc adapter to transfer the dataset to the jsonb field (postgres 9.4).
After import, the date fields look correct, but are displayed in an environment with double entries. Is there a way to determine if they are actually stored internally as date values? If they are strings, I donโt think range searching will be very efficient.
For example, an entry in the jsonb properties field looks like this:
"founded_on": "Sep 1, 2012 12:00:00 AM",
Now I can do a search, let's say
SELECT CAST(properties->>'founded_on' AS DATE
and
SELECT extract('year' from cast(properties->>'founded_on' as timestamp))
and both work fine, but don't tell me whether Postgres will redraw the string value in the jsonb field each time as a date.
I could create an index in which I passed these values โโas dates and used them to search, but it seems somewhat inelegant. I would rather know that the stored value is a date. Integers and floats are apparently their eigenvalues, not strings, for example:
shares_sold": 5900000,
"latitude": 33.561467,
Any feedback is much appreciated.
source share