Re: mysql replace in postgreSQL?

Поиск
Список
Период
Сортировка
От Lincoln Yeoh
Тема Re: mysql replace in postgreSQL?
Дата
Msg-id 5.2.1.1.1.20051103175440.03feceb0@localhost
обсуждение исходный текст
Ответ на Re: mysql replace in postgreSQL?  (Jan Wieck <JanWieck@Yahoo.com>)
Список pgsql-general
At 12:28 AM 11/2/2005 -0500, Jan Wieck wrote:

>Using REPLACE INTO at one place and creating duplicates on purpose in
>another seems to make zero sense to me. Until one can explain the reason
>for that to me, I claim that a UNIQUE constraint on such key is a logical
>consequence.

I believe it is better to tell people to use UNIQUE constraints to avoid
duplicates than to tell them to use a particular stored procedure. I was
just pointing out that the "magic" wasn't really in the stored procedure.

Especially since that particular stored procedure does not generalize
easily - you have to change it to use it on another table. Users might make
mistakes of using the procedure on a table without a uniqueness constraint
in the right fields, or the wrong uniqueness constraint (e.g. different
collation from the one they use in a select).

Whereas if they had a REPLACE/PUT/MERGE with similar syntax as an UPDATE,
that is less likely to increase the possibility of errors.

Regards,
Link.



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

Предыдущее
От: Michael Fuhr
Дата:
Сообщение: Re: Problem with array in plpgsql function .. please help :-)
Следующее
От: Hannes Dorbath
Дата:
Сообщение: Re: SQL injection