Re: Upsert error "column reference is ambiguous" - Mailing list pgsql-general

From Peter Geoghegan
Subject Re: Upsert error "column reference is ambiguous"
Date
Msg-id CAH2-Wzn+euNGrOyaO0xxbJMo7od27jsBdwfS+C+wvbcPsWEd3A@mail.gmail.com
Whole thread Raw
In response to Upsert error "column reference is ambiguous"  (Tim Starling <tstarling@wikimedia.org>)
List pgsql-general
On Mon, Apr 28, 2025 at 12:56 AM Tim Starling <tstarling@wikimedia.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



pgsql-general by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Upsert error "column reference is ambiguous"
Next
From: Tom Lane
Date:
Subject: Re: Upsert error "column reference is ambiguous"