Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8810085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:02:30+00:00 2026-06-14T03:02:30+00:00

I recently switched from MySQL to PostgreSQL in my Django app and I need

  • 0

I recently switched from MySQL to PostgreSQL in my Django app and I need to set last values of all sequences on max. number of corresponding table and column. How can I get all sequences related to a table? So far I am doing somethign like:

SELECT sequence_name FROM information_schema.sequences 
WHERE sequence_name LIKE 'table_name%';

but I dont’t like this approach, mostly because I have to additionally clean the results. Is there some ID that connects table with their sequences.

Now I can’t add any object to my database, because Postgre “auto increment” is running from 1 and new objects’ PKs are clashing with existing records.

Note: My django app is quite large and I am using several additional package, so the naming convention is not consistent (table names are with / without app pefix, PK columns are like ‘tableid’ or ‘table_id’ of just ‘id’ and so on)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T03:02:31+00:00Added an answer on June 14, 2026 at 3:02 am

    try with:

    python manage.py sqlsequencereset <appname>
    

    and feed that to psql cli

    HTH

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently switched from MySQL to PostgreSQL. I have one problem left however. Previously,
Recently, I switched from Visual Studio to Eclipse CDT. I've set it up beautifully
I recently switched my rails database over from sqlite3 to mysql, and since doing
We recently switched a database from MSSQL to MySQL and the queries that uses
i recently switched from cs5.5 to FlashDevelop and i have trouble publishing my app
I recently switched from a Java based project to a C#/.net project. I previously
I recently switched from using Linq to Sql to the Entity Framework. One of
We recently switched from SVN to Git and we're still kind of in the
I've recently switched focus from VB.NET to C# due to some decisions at work.
I've recently switched my app over to Rails 3.1 and began using the asset

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.