3 time timestamp without time zone default now(),
7 sensor_type int default null,
12 CREATE OR REPLACE FUNCTION json_fn()
16 NEW := jsonb_populate_record(NEW, NEW.json); -- or hstore alternative
19 $func$ LANGUAGE plpgsql;
21 CREATE TRIGGER json_trigger
22 BEFORE INSERT OR UPDATE ON eg5120 FOR EACH ROW
23 EXECUTE PROCEDURE json_fn();