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 9189513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:15:15+00:00 2026-06-17T20:15:15+00:00

If you attempt to set a sequence number like this: SELECT setval(‘table_ID_seq’, (SELECT max(ID)

  • 0

If you attempt to set a sequence number like this:

SELECT setval('table_ID_seq', (SELECT max("ID") + 1 FROM table));

You might encounter the following error:

ERROR:  relation "table_ID_seq" does not exist
LINE 1: SELECT setval('table_ID_seq', (SELECT max("ID") + 1 FROM t...
                      ^

********** Error **********

ERROR: relation "table_id_seq" does not exist
SQL Status:42P01
  • 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-17T20:15:16+00:00Added an answer on June 17, 2026 at 8:15 pm

    The problem is that PostgreSQL will normalize identifier names unless they are put in double quotes.

    However, this will not work:

    SELECT setval("table_ID_seq", (SELECT max("ID") + 1 FROM table));
    

    Instead, you will have to put single-quotes around the double-quoted text:

    SELECT setval('"table_ID_seq"', (SELECT max("ID") + 1 FROM table));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to know if i attempt to set bits inside a char/integer from
in an attempt to see and hopefully understand actionscript's garbage collector, i've set up
First attempt to use this cool site - after searching for 2 hours: So
I attempt to use webservice return POCO class generated from entity data model as
This is my first attempt at responsive design, so I'm keeping it simple. I
I want to populate a table column with a running integer number, so I'm
Whenever I attempt to set the default value of an optional parameter to something
My current code to attempt to set widths for the rows on a gridview
I'm consistently running into an invalid selector exception when I attempt to set multiple
Great page this one, coming from the perl world and after several years of

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.