Conditional INSERT

Поиск
Список
Период
Сортировка
От basti
Тема Conditional INSERT
Дата
Msg-id 68951fae-3281-c9ad-09b7-205e0bb1c5ae@unix-solution.de
обсуждение исходный текст
Ответы Re: Conditional INSERT  (Michel Pelletier <pelletier.michel@gmail.com>)
Re: Conditional INSERT  (Paul Jungwirth <pj@illuminatedcomputing.com>)
Re: Conditional INSERT  (Andreas Kretschmer <andreas@a-kretschmer.de>)
Список pgsql-general
Hello,

I want to insert data into table only if condition is true.
For example:

INSERT into  mytable (domainid, hostname, txtdata)
  VALUES (100,'_acme.challenge.example', 'somedata');

The insert should only be done if Hostname like %_acme.challenge%.

How can it be done? I dont want that the user/script can insert any value.

Best regards.


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

Предыдущее
От: Michel Pelletier
Дата:
Сообщение: Re: jsonb_set performance degradation / multiple jsonb_set onmultiple documents
Следующее
От: Michel Pelletier
Дата:
Сообщение: Re: Conditional INSERT