Re: ON CONFLICT DO UPDATE

Поиск
Список
Период
Сортировка
От tango ward
Тема Re: ON CONFLICT DO UPDATE
Дата
Msg-id CAA6wQL+sFc4T=XcHFcuE+4=nZzZkwS+FQm0rWNTuFbwVxtFGJw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: ON CONFLICT DO UPDATE  (Alban Hertroys <haramrae@gmail.com>)
Список pgsql-general
Yes, that's what I figured out eventually. I thought, only the columns that I declared inside the ON CONFLICT()  parenthesis can be called in SET. My bad.

On Thu, May 10, 2018 at 5:57 PM, Alban Hertroys <haramrae@gmail.com> wrote:

> On 10 May 2018, at 7:13, tango ward <tangoward15@gmail.com> wrote:

>                          ON CONFLICT (school_system_id,
>                                       student_id,
>                                       campus_name
>                                       ) DO UPDATE
>                               SET school_system_id = excluded.school_system_id,
>                                   student_id = excluded.student_id,
>                                   campus_name = excluded.campus_name

I'm pretty sure this ought to read:
        ON CONFLICT (school_system_id, student_id, campus_name)
        DO
           UPDATE SET modified = EXCLUDED.modified,
                balance = EXCLUDED.balance,
                balance_as_of = EXCLUDED.balance_as_of

Instead, you were re-assigning the keys (school_system_id, student_id, campus_name) to the same values again.

Alban Hertroys
--
If you can't see the forest for the trees,
cut the trees and you'll find there is no forest.


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

Предыдущее
От: Alban Hertroys
Дата:
Сообщение: Re: ON CONFLICT DO UPDATE
Следующее
От: Ben Hood
Дата:
Сообщение: Re: Domain based on TIMEZONE WITH TIME ZONE