Re: Renaming sequences - Mailing list pgsql-novice

From Justin
Subject Re: Renaming sequences
Date
Msg-id CALL-XeM7QFn3NBJz7VfpnAphwCU7pubwyymaQN4cd_tt+OWaPg@mail.gmail.com
Whole thread Raw
In response to Re: Renaming sequences  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-novice
If using Django with its ORM it cares what the name of the sequences are along with anything it creates.  

The ORM has pretty much recreated the entire Relation Database Model, DDL, DML and abstracted it in a Object Model.  

The naming schema is tablename+column+UUID .   Changing the names will bugger up the Django Migrations 

to give an idea how horrible ORM can get with foreign keys and constraints take a look at this one table created with Django ORM. 

 
image.png

On Wed, Dec 18, 2019 at 8:53 AM Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
On 2019-Dec-18, Mike Dewhirst wrote:

> That sounds promising. I would really like the sequence name aligned
> with the table name. I was thinking of simply editing a dump file and
> reloading to achieve it.Is that a rational approach?

I don't find it so, but it seems subjective ... YMMV.

I would just copy the database (CREATE DATABASE WITH TEMPLATE) to a test
throwaway one, do the ALTER SEQUENCE there, point the application to it,
and see if it works.  If it does, drop that database and repeat the
ALTER SEQUENCE in your original database.

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


Attachment

pgsql-novice by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Renaming sequences
Next
From: Michael Gaston
Date:
Subject: REMOVE