Conrad,this is the wrong list for your question, use pgsql-hackers instead.
Usually, I'd implement your indirect dereferencing using a runtime compiled query string, as the doc show it.
Regards,Andreas