Is it possible to define an array of text fields (or any data type) and select a value from it, all within a single statement? For example:
SELECT ARRAY['First', 'Second', 'Third'][mytable.state] as interpreted_state WHERE mytable.id = 1;
SELECT * FROM mytable.id WHERE columns IN ("1","2","3");
if I understood correctly what you meant..