I'm storing a value in a variable featureId and then trying to use that value in my SELECT statement, but postgres seems to be taking the name literally and looking for a column called "featureid". I'm getting an error "ERROR: column "featureid" does not exist
LINE 4: featureId,"
My code is below. How can I use the value of the variable in my SELECT statement?
SELECT id INTO featureId FROM tableA WHERE NAME = 'some value';
INSERT INTO tableB (client_id, feature_id, does_have)
SELECT
id,
featureId,
TRUE
FROM tableA