Re: Promise index tuples for UPSERT

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: Promise index tuples for UPSERT
Дата
Msg-id 5434F517.8070009@vmware.com
обсуждение исходный текст
Ответ на Re: Promise index tuples for UPSERT  (Peter Geoghegan <pg@heroku.com>)
Ответы Re: Promise index tuples for UPSERT
Список pgsql-hackers
On 10/08/2014 11:10 AM, Peter Geoghegan wrote:
> The reasoning behind making the unique index specification optional is:
>
> We cannot easily cover corner cases with another syntax - unique
> indexes must be named directly to cover every case, and make the
> user's intent absolutely clear. That's not obviously the case, but
> consider partial unique indexes, for example. Or consider uniquely
> constrained columns, with an almost equivalent uniquely constrained
> expression on those same columns. On the one hand I am not comfortable
> failing to support those, but on the other hand it could get very
> messy to do it another way.
>
> As we all know, naming a unique index in DML is ugly, and has poor
> support in ORMs.

I vehemently object to naming indexes in the UPSERT statement. That 
mixes logical and physical database design, which is a bad idea. This is 
not ISAM.

Instead of naming the index, you should name the columns, and the system 
can look up the index or indexes that match those columns.

(Remind me again, where did this need to name an index come from in the 
first place?)

- Heikki




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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: Promise index tuples for UPSERT
Следующее
От: Marti Raudsepp
Дата:
Сообщение: Re: INSERT ... ON CONFLICT {UPDATE | IGNORE}