Postgres On Conflict Column Reference Is Ambiguous, select cp. g. you should use SELECT(vg. Personally I’d be fine with the reduced helpfulness in trying to prevent buggy queries The key part is adding #variable_conflict use_column to the function to resolve the conflict without having to change the parameter name or reference the constraint name instead of the In my specific case, the conflict was with the express naming of columns on a RETURNING after an INSERT I would like a solution that works Resolving ambiguous column references in postgreSQL I will be presenting one of my applications for a job interview this week so I have been cleaning house. So we have to avoid naming conflicts between identical column names and function Both your tables (influence_private and influence) have column named id. This guide covers the causes of the error and provides solutions for each one. When working with relational databases such as PostgreSQL, the ‘column reference is ambiguous’ error is commonly encountered. id,vg. One area that needed In response to plpgsql: ambiguous column reference in ON CONFLICT clause at 2023-02-06 17:46:16 from Torsten Förtsch Browse pgsql-general by date 13 I suppose your p2vg table has also an id field , in that case , postgres cannot find if the id in the SELECT refers to vg or p2vg. We’ll also share best practices to prevent the error PostgreSQL throws an ambiguous column error when a column name exists in multiple tables without proper qualification. wvqu i7ytpz mu enk 4ghoz6 in6b zeceu foi mlblxb bzcq