Re: Need help with trigger

Поиск
Список
Период
Сортировка
От Melvin Davidson
Тема Re: Need help with trigger
Дата
Msg-id CANu8FiyfSHd=9dewgCEDG0dUQUUnMQy2fuR6KFtFeOm8jVU8vA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Need help with trigger  (Adrian Klaver <adrian.klaver@aklaver.com>)
Ответы Re: Need help with trigger  (Condor <condor@stz-bg.com>)
Список pgsql-general
Maybe this example will help.

INSERT INTO distributors AS d (did, dname) VALUES (8, 'Anvil Distribution')
    ON CONFLICT (did) DO UPDATE
    SET dname = EXCLUDED.dname || ' (formerly ' || d.dname || ')'
    WHERE d.zipcode <> '21201';

On Sat, Jan 23, 2021 at 3:47 PM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 1/23/21 12:14 PM, Condor wrote:
> On 23-01-2021 20:49, Adrian Klaver wrote:
>> On 1/23/21 10:20 AM, Condor wrote:

>
> Sorry,
>
> I'm sorry, I don't understand something. You mean to do pure INSERT ON
> CONFLICT DO or to modify the trigger ?

No I meant that in the external program you use to fetch the data from
the other table and reorganize the fields.  Do your test there and do
either the INSERT or UPDATE.


--
Adrian Klaver
adrian.klaver@aklaver.com




--
Melvin Davidson
Maj. Database & Exploration Specialist

Universe Exploration Command – UXC

Employment by invitation only!

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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Need help with trigger
Следующее
От: Ron
Дата:
Сообщение: Question about logically replicating a multi-TB database