42703: undefined_column
PostgreSQLWhat does it mean?
The column referenced in the query does not exist in the table or in the current scope.
Why does it happen?
A typo in the column name, the column having been dropped/renamed, a reference to the wrong table, a quoted-identifier case mismatch, or ambiguous/incorrect qualification in a multi-table query.
How to fix it
List the columns: \d my_table or SELECT column_name FROM information_schema.columns WHERE table_name = 'my_table'. Correct the name and the table, and qualify columns in JOINs as table.column. If quotes were used at creation, reference it with the same case.