Stephen Ingram <ingram(at)samsix(dot)com> writes:
> Is it possible (legal syntax, I mean) to pass a tablename
> as a parameter to a function?
You could pass the tablename as a string argument (eg, text or varchar)
and then construct your queries as strings for plpgsql's EXECUTE
function. This is notationally tedious, and you lose some performance
because there's no possibility to cache and reuse query plans, but
it will work.
regards, tom lane