"Jim C. Nasby" <decibel(at)decibel(dot)org> writes:
> You could possibly do this with a SRF; you'd have to grab the name of
> the table and then build a dynamic query off of that. If you cast the
> oid to regclass you'll get the name of the table, though you should
> probably query pg_class and pg_namespace to build a fully-qualified
> table name (schemaname.tablename).
The regclass cast will take care of that for you.
regards, tom lane