如何消除postgresql大容量upsert中不明确的列引用错误?

如何消除postgresql大容量upsert中不明确的列引用错误?,postgresql,bulkinsert,upsert,bulkupdate,Postgresql,Bulkinsert,Upsert,Bulkupdate,对于下面的代码,我正在尝试向表中批量插入。该表称为jobstep\u-to\u-step\u关系。如果表中已经存在主键列job_base_step_id,我希望算法执行更新 create table jobstep_to_step_relationships ( job_base_step_id uuid default uuid_generate_v4() not null constraint jobstep_to_step_relation

对于下面的代码,我正在尝试向表中批量插入。该表称为jobstep\u-to\u-step\u关系。如果表中已经存在主键列job_base_step_id,我希望算法执行更新

create table jobstep_to_step_relationships

    (
        job_base_step_id uuid default uuid_generate_v4() not null
            constraint jobstep_to_step_relationships_pkey
                primary key,
        step_id uuid not null,
        parent_job_base_step_id uuid not null,
        parent_step_id uuid not null,
        job_id uuid not null,
        order_number integer not null,
        is_group boolean not null,
        created_at bigint not null,
        updated_at bigint not null
    );




INSERT INTO jobstep_to_step_relationships
(job_base_step_id, step_id, parent_job_base_step_id, parent_step_id, job_id, order_number,
 is_group, created_at, updated_at)
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9),
       ($1, $2, $3, $4, $5, $6, $7, $8, $9)
ON CONFLICT (job_base_step_id)
    DO UPDATE SET job_base_step_id        = EXCLUDED.job_base_step_id,
                  step_id                 = EXCLUDED.step_id,
                  parent_job_base_step_id = EXCLUDED.parent_job_base_step_id,
                  parent_step_id          = EXCLUDED.parent_step_id,
                  job_id                  = EXCLUDED.job_id,
                  order_number            = EXCLUDED.order_number,
                  is_group                = EXCLUDED.is_group,
                  created_at              = EXCLUDED.created_at,
                  updated_at              = EXCLUDED.updated_at
WHERE EXCLUDED.job_base_step_id = job_base_step_id
  AND EXCLUDED.step_id = step_id
但是,对于以下发布的代码,我得到了以下错误:

[2019-06-25 13:17:47] [42702] ERROR: column reference "job_base_step_id" is ambiguous

不确定我从文档中解释了什么错误。有人能指出哪里不对吗

指定表名以修复歧义:

其中EXCLUDED.job_base_step_id=jobstep_to_step_relationships.job_base_step_id 和排除。步骤id=作业步骤到步骤关系。步骤id