Re: CREATE IF NOT EXISTS INDEX

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: CREATE IF NOT EXISTS INDEX
Дата
Msg-id 542B283F.9010806@agliodbs.com
обсуждение исходный текст
Ответ на CREATE IF NOT EXISTS INDEX  (Fabrízio de Royes Mello <fabriziomello@gmail.com>)
Ответы Re: CREATE IF NOT EXISTS INDEX
Re: CREATE IF NOT EXISTS INDEX
Re: CREATE IF NOT EXISTS INDEX
Список pgsql-hackers
On 09/30/2014 02:43 PM, Tom Lane wrote:
> Fabrízio de Royes Mello <fabriziomello@gmail.com> writes:
>> What's your thoughts about we implement IF NOT EXISTS for CREATE INDEX?
> 
> It's got the same semantic problems as every other variant of CINE.
> 
> If there were a huge groundswell of demand for it, maybe we'd hold our
> noses and do it anyway.  But I'm against doing it without that.

This isn't the sort of thing there would ever be a clamor of support
for, because it's just not that visible of a feature.  It's more of a
regular annoyance for those who encounter it.  More importantly, adding
an IF NOT EXISTS to CREATE INDEX would allow complete idempotent "create
this bunch of tables" scripts, since now the "create index" statements
could be included.  This would be very nice for schema management tools.

I do think it should be name-based.  While an "IF NOT EXISTS" which
checked for a duplicate column declartion would be nice, there's a raft
of issues with implementing it that way.  Users I know are generally
just looking to avoid getting a transaction-halting error when they run
the same create index statement twice.

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com



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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: autovacuum scheduling starvation and frenzy
Следующее
От: Andres Freund
Дата:
Сообщение: Re: INSERT ... ON CONFLICT {UPDATE | IGNORE}