Convert to Postgres storage, HTSQL queries