Basically, at least for proof of concept, I want a function where I can run: SELECT res('table_name'); and this will give me the results of SELECT * FROM table_name;. The issue I am having is schema...in the declaration of the function I have:
CREATE OR REPLACE FUNCTION res(table_name TEXT) RETURNS SETOF THISISTHEPROBLEM AS
The problem is that I do not know how to declare my return, as it wants me to specify a table or a schema, and I won't have that until the function is actually run.
Any ideas?