How can I find the table name for each row result in my query?
I have tried ideas suggested on the stack network (overflow, dba)
1 How to make a table name an attribute in PostgreSQL?
The template is the parent that spawns all the child tables I am searching. When I search just name and state, I get expected results, but they all come from different tables
select first_name, last_name, state
from template
where completed_interview_flag = 1
When I add the tablename as suggested, to try to find the source table name - I get an error
select tableoid::regclass AS source, first_name, last_name, state
from template
where completed_interview_flag = 1
********** Error **********
ERROR: column "tableoid" does not exist
SQL state: 42703
Character: 8