0
CREATE TABLE conditions (
  time        TIMESTAMPTZ       NOT NULL,
  temperature DOUBLE PRECISION  NULL,
  humidity    DOUBLE PRECISION  NULL,
  log json not null
);

Query 1 ERROR: ERROR: could not find hash function for type json

Creating a distributed hypertable after creating a table results in an error.

If you change the log type to Jsonb and create a distributed hypertable, it will work normally.

Can't Json type be used to create a distributed hypertable?

  • One reason could be that you can just stringify your JSON and create the hash based on that string. However, the issue is that equivalent JSON objects can be structurally different (e.g. the order of properties) which can produce different strings and thus create different hashes for basically the same data. Are you trying to use this log column as a dimension entity? With the time dimension then things should work ok. Feel free to fill an issue in the GitHub issues in case it does not work. – jonatasdp Dec 02 '22 at 13:26

0 Answers0