Re: Upsert error "column reference is ambiguous"

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Tim Starling <tstarling(at)wikimedia(dot)org>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Upsert error "column reference is ambiguous"
Date: 2025-04-28 13:30:02
Message-ID: CAH2-Wzn+euNGrOyaO0xxbJMo7od27jsBdwfS+C+wvbcPsWEd3A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Apr 28, 2025 at 12:56 AM Tim Starling <tstarling(at)wikimedia(dot)org> wrote:
> Our application has an upsert method which takes the assignment
> "v=v+1" as a string. It is feasible to split it on the equals sign
> into the destination field and expression components, but it is not
> feasible to parse the expression or to require callers to supply an
> AST tree for the expressions they give us. It is not feasible to
> require callers to prefix all field names with the table name.

You can use an alias for the target table name. Is it feasible to
require callers to prefix all field names with a generic table name
alias?

--
Peter Geoghegan

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2025-04-28 13:54:09 Re: Upsert error "column reference is ambiguous"
Previous Message Laurenz Albe 2025-04-28 13:29:51 Re: Upsert error "column reference is ambiguous"