How to disambiguate a plpgsql variable name in a ON CONFLICT clause?
问题 Given this table: create table test ( name text primary key ); I need to write a plpgsql function with a variable name that collides with the primary key name, which I must use in a on conflict clause: create or replace function func( name text -- this variable name... ) returns void language plpgsql as $$ begin insert into test (name) values (name) on conflict (name) do update -- ...conflicts with this line set name = func.name; end; $$; This compiles, but then throws an ambiguous column