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

  • Home
  • SEARCH
  • 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 8216463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:08:04+00:00 2026-06-07T12:08:04+00:00

I have a PostgreSQL schema defined using liquibase. I have used ‘SERIAL’ datatype. For

  • 0

I have a PostgreSQL schema defined using liquibase. I have used ‘SERIAL’ datatype. For these datatypes, the database creates a sequence in it’s pg_catalog table with some specific name. Now I am porting my application to support Oracle. I added a separate change-set for creating a sequence. The sequence name created by PostgreSQL is very large and Oracle does not allow it. I need to modify my schema definition such that both would have same sequence name. This is because I am using hibernate and need to specify the same in the respective hbm files.

The alternative that I can think of is to have a different change set for PostgreSQL and Oracle. For PostgreSQL, it would have create table tag that would generate query something like mentioned here [http://www.postgresql.org/docs/8.1/static/datatype.html#DATATYPE-SERIAL]. And then another change-set for Oracle to just create the table and associated sequence.

I am interested in knowing if this is the right and only approach to achieve this.

  • 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-07T12:08:05+00:00Added an answer on June 7, 2026 at 12:08 pm

    In PostgreSQL you can create the sequence with any name. The data type serial is just shorthand for – I quote the manual here:

    CREATE SEQUENCE tablename_colname_seq;
    CREATE TABLE tablename (
        colname integer NOT NULL DEFAULT nextval('tablename_colname_seq')
    );
    ALTER SEQUENCE tablename_colname_seq OWNED BY tablename.colname;
    

    So use shorter names for your sequences. Or use shorter table names and save yourself the hassle.

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

Sidebar

Related Questions

I have an existing schema defined using Liquibase for PostgreSQL. I am adding support
I'm designing a database schema using PostgreSQL. I have some doubts about which design
I'm using PostgreSQL 9.1 and have to to grant create schema ON database to
I have a postgresql database and am using it for a project which handles
I have a column in a PostgreSql database that is defined with type boolean[]
I have a PostgreSQL database for my Rails application. In the schema named 'public'
I have executed the following create statement using SQLWorkbench at my target postgresql database:
I have created a new schema in my PostgreSQl database with psql: CREATE SCHEMA
I have legacy Database Schema (PostgreSQL) I cant change it. I'm having problems mapping
Background: I have a PostgreSQL (v8.3) database that is heavily optimized for OLTP. I

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.