Thanks for the Postgres porting time you've put in!.
Yes, I don't see a problem with using something like the context id (I don't know a lot about contexts) or the system name to use in the table naming. In group-data, we could just make the change to gd_tablename function, and for attributes we could provide a similar attribute_tablename function to return the corresponding table. We'd also have to make the correct changes to the create/delete sql statements for installing/enabling the package.
Thoughts?