Re: Insert data if it is not existing

Поиск
Список
Период
Сортировка
От tango ward
Тема Re: Insert data if it is not existing
Дата
Msg-id CAA6wQLJP86LvzJYJqFpkAaL4X45N_EWo+GD7z8mbq2JY9m-CbA@mail.gmail.com
обсуждение исходный текст
Ответ на RE: Insert data if it is not existing  (Steven Winfield <Steven.Winfield@cantabcapital.com>)
Ответы RE: Insert data if it is not existing  (Steven Winfield <Steven.Winfield@cantabcapital.com>)
Список pgsql-general
thanks for the response Steven.

Will ON CONFLICT DO UPDATE/NOTHING if there's no error?

On Wed, May 23, 2018 at 5:43 PM, Steven Winfield <Steven.Winfield@cantabcapital.com> wrote:

INSERT … ON CONFLICT DO UPDATE … is probably what you want, perhaps using a specified unique index/constraint:

https://www.postgresql.org/docs/10/static/sql-insert.html#SQL-ON-CONFLICT

 

Steve.

 

From: tango ward [mailto:tangoward15@gmail.com]
Sent: 23 May 2018 10:04
To: pgsql-generallists.postgresql.org
Subject: Insert data if it is not existing

 

 

Hi,

 

I just want to ask if it's possible to insert data if it's not existing yet. I was able to play around with UPSERT before but that was when there was an error for duplicate data. In my scenario, no error message is showing.

 

 

Any suggestion?

 

 

Thanks,

J



This email is confidential. If you are not the intended recipient, please advise us immediately and delete this message. The registered name of Cantab- part of GAM Systematic is Cantab Capital Partners LLP. See - http://www.gam.com/en/Legal/Email+disclosures+EU for further information on confidentiality, the risks of non-secure electronic communication, and certain disclosures which we are required to make in accordance with applicable legislation and regulations. If you cannot access this link, please notify us by reply message and we will send the contents to you.

GAM Holding AG and its subsidiaries (Cantab – GAM Systematic) will collect and use information about you in the course of your interactions with us. Full details about the data types we collect and what we use this for and your related rights is set out in our online privacy policy at https://www.gam.com/en/legal/privacy-policy. Please familiarise yourself with this policy and check it from time to time for updates as it supplements this notice

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

Предыдущее
От: Steven Winfield
Дата:
Сообщение: RE: Insert data if it is not existing
Следующее
От: legrand legrand
Дата:
Сообщение: Re: Help in Postgresql