@Lacak: mmmm, yes, and presumably (just guessing) various dbs do have extensions to that that do allow substituting table names for params?
Read a bit about dynamic SQL in MS SQL Server but that doesn't sound very safe. Also don't know what Postgresql (which the OP uses) would use.