Re: doc: Clarify what "excluded" represents for INSERT ON CONFLICT

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: doc: Clarify what "excluded" represents for INSERT ON CONFLICT
Дата
Msg-id 717439.1656682842@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: doc: Clarify what "excluded" represents for INSERT ON CONFLICT  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: doc: Clarify what "excluded" represents for INSERT ON CONFLICT  (Peter Geoghegan <pg@bowt.ie>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> I think that the issue here is simply that because both the updated
> table and the "excluded" pseudo-table are visible here, and have the
> same columns, an unqualified name is ambiguous. I don't really think
> that it's worth documenting. The error message you get if you fail to
> do it is actually pretty good:

> ERROR:  column reference "b" is ambiguous

> Now you could read that and not understand that the ambiguity is
> between the target table and the "excluded" pseudo-table, for sure.

Agreed.  It doesn't help that there's no explicit use of "excluded"
anywhere, as there is in more usual ambiguous-column cases.

> What would probably help more is adding something like this to the
> error message:
> HINT: column "b" could refer to any of these relations: "foo", "excluded"

+1, that seems like it could be handy across the board.

            regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Refactor construct_array() and deconstruct_array() for built-in types
Следующее
От: Przemysław Sztoch
Дата:
Сообщение: Re: generate_series for timestamptz and time zone problem