SELECT INTO temp primary_key_id from a_table where
a_table.value='something';
However this seems to only work within creating functions. Probably
because it's being interpreted as standard sql instead of plpgsql.
This would probably mean the real question is can i ecapsulate a
sequence of sql statements with plpgsql?