How to create a SET-like type on postgresql
Use the HSTORE column type. HSTORE stores key/value pairs. You can use null values if you only care about checking if a key exists. See https://www.postgresql.org/docs/current/static/hstore.html. For example, to ask Is ‘x’ in my hstore?, do CREATE EXTENSION HSTORE; –create extension only has to be done once SELECT * FROM ‘x=>null,y=>null,z=>null’::HSTORE ? ‘x’; I believe … Read more