I'm trying to define a function that references a temp table that will be defined in the future, but I'm getting the following error on creation:
DROP FUNCTION IF EXISTS test_function();
CREATE FUNCTION test_function()
RETURNS void AS $$
SELECT * FROM temp_table
$$ LANGUAGE SQL;
ERROR: relation "_temp_table" does not exist LINE 7: FROM temp_table
Is there a way to define a Postgresql function that referenes a table that doesn't exist?
I can create an empty temp table as part of the function creation - but it's a bit ugly...
Any help will be appreciated...
Thanks