I have the following table:
test=# CREATE TABLE stmts(id SERIAL, selector VARCHAR(255));
CREATE TABLE
test=# INSERT INTO stmts(selector) VALUES('5 > 3'),('5 < 3');
INSERT 0 2
test=# SELECT selector FROM stmts;
selector
----------
5 > 3
5 < 3
(2 rows)
I want to amend the select to be able to evaluate the value of the selector for each row, so desired effect is:
selector, magic FROM stmts;
selector | magic
--------------------
5 > 3 | true
5 < 3 | false
(2 rows)
It would be great if this was executed in the context of the row, so we can evaluate for example expression id = 5
, etc.
Is this even possible?