Re: ERROR: type "foo_20110307_id_seq" already exists (expected relation "foo_20110307_id_seq" already exists)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: ERROR: type "foo_20110307_id_seq" already exists (expected relation "foo_20110307_id_seq" already exists)
Дата
Msg-id 3313.1301063377@sss.pgh.pa.us
обсуждение исходный текст
Ответ на ERROR: type "foo_20110307_id_seq" already exists (expected relation "foo_20110307_id_seq" already exists)  ("Marc Mamin" <M.Mamin@intershop.de>)
Ответы Re: ERROR: type "foo_20110307_id_seq" already exists (expected relation "foo_20110307_id_seq" already exists)  (Peter Geoghegan <peter@2ndquadrant.com>)
Список pgsql-general
"Marc Mamin" <M.Mamin@intershop.de> writes:
> By trying to create a sequence that already exists, I'd expect an error
> like
> relation "foo_20110307_id_seq" already exists,
> and not
> type "foo_20110307_id_seq" already

My recollection is that it's possible to get the latter if multiple
sessions try to create the same relation name concurrently.  The initial
check for "does the relation already exist" fails for both sessions,
so they plow ahead, and then you're at the mercy of timing as to whether
you get a unique-index violation on pg_class or pg_type.  It may well
also vary as to which PG version you're using.

            regards, tom lane

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

Предыдущее
От: Luca Santaniello
Дата:
Сообщение: Re: cursor with dinamic string
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: ERROR: type "foo_20110307_id_seq" already exists (expected relation "foo_20110307_id_seq" already exists)