Re: Renaming sequences

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Renaming sequences
Дата
Msg-id 20191218113431.GA11607@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: Renaming sequences  (Mike Dewhirst <miked@dewhirst.com.au>)
Список pgsql-novice
On 2019-Dec-18, Mike Dewhirst wrote:

> On 18/12/2019 5:03 pm, Zahid Rahman wrote:
> > 
> > If you are referring to a sequence which meets the same definition
> > below. That is to say a persistent number generator.
> > 
> > Surely by  changing  the sequence name then any  code using that
> > sequence by name will fail. That's from an application developer's view.
> 
> Yes.
> 
> I think I'd better ask on the Django users list.
> 
> The fact that it is working with mismatched names probably means it would
> stop working if I adjusted them. Django probably reads the migration record
> to establish which sequence to use.

I don't know django, but it's certainly possible that it's obtaining the
sequence name from the Postgres catalogs, not from its own migration
record; there's introspection facilities in Postgres for that.  I would
be surprised if it breaks just because you rename a sequence whose name
does not appear directly in its database definition.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



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

Предыдущее
От: Sanjay
Дата:
Сообщение: Re[2]: Health warning:
Следующее
От: Zahid Rahman
Дата:
Сообщение: Re: Re[2]: Health warning: