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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:25:41+00:00 2026-05-26T05:25:41+00:00

I just want to migrate my application from MYSQL to PostgreSQL. I am stuck

  • 0

I just want to migrate my application from MYSQL to PostgreSQL. I am stuck at one point,

CREATE TABLE some_table 
(
  sequenceNumOnTarget        BIGINT NOT NULL,
  streamStartTime            BIGINT,
  intervalStartTime          BIGINT NOT NULL,
  intervalNumber             SMALLINT,
  intervalDuration           INTEGER,
  lastReport                 TINYINT,
  macAddr                    VARCHAR(20) NOT NULL,
  directoryNumber            VARCHAR(30),
  subnetMask                 VARCHAR(20),
  subnetAddress              VARCHAR(20),
  ipAddress                  VARCHAR(20),
  icpName                    VARCHAR(20),
  udpPort                    INTEGER NOT NULL,
  tcpPort                    INTEGER,
  endpointContext            SMALLINT,
  endpointType               SMALLINT,
  farEndIpAddress            VARCHAR(20),
  farEndMacAddr              VARCHAR(20),
  farEndDirectoryNumber      VARCHAR(30),
  farEndUdpPort              INTEGER,
  farEndTcpPort              INTEGER,
  farEndType                 SMALLINT,
  farEndSubnet               VARCHAR(20),
  farEndIcpName              VARCHAR(20),
  codec                      SMALLINT,
  packetsReceived            BIGINT,
  DELAY INTEGER,
  jitterRfc1889              INTEGER,
  averageJitter              INTEGER,
  jitterHist0                INTEGER,
  jitterHist1                INTEGER,
  jitterHist2                INTEGER,
  jitterHist3                INTEGER,
  jitterHist4                INTEGER,
  jitterHist5                INTEGER,
  jitterHist6                INTEGER,
  jitterHist7                INTEGER,
  jitterBufferOverflow       BIGINT,
  jitterBufferUnderflow      BIGINT,
  jitterBufferAverageDepth   INTEGER,
  jitterBufferMaxDepth       INTEGER,
  packetLoss                 BIGINT,
  packetLossMaxBurst         BIGINT,
  packetLossHist0            INTEGER,
  packetLossHist1            INTEGER,
  packetLossHist2            INTEGER,
  packetLossHist3            INTEGER,
  packetLossHist4            INTEGER,
  packetLossHist5            INTEGER,
  packetLossHist6            INTEGER,
  packetLossHist7            INTEGER,
  packetsOutOfOrder          BIGINT,
  maxJitter                  BIGINT,
  networkMos                 INTEGER,
  userMos                    INTEGER,
  pollId                     BIGINT,
  instance                   VARCHAR(100),
  ttime                      BIGINT NOT NULL,
  PRIMARY KEY (sequenceNumOnTarget,macAddr,udpPort), 
  INDEX vq_subnet(subnetAddress),
  INDEX vq_ttime(ttime), 
  INDEX vq_pollid(pollId),
  INDEX vq_sequence(sequenceNumOnTarget),
  INDEX vq_icp(icpName)
);

This is my table definition in MySQL and now I want to convert it to PostgreSQL.

But can’t find a DDL statement suitable to ‘create table and indexing both with one single query’ in PostgreSQL.

Can anyone help..

  • 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-05-26T05:25:41+00:00Added an answer on May 26, 2026 at 5:25 am

    I don’t believe you can add indexes (other than those created implicitly to enforce UNIQUE and PRIMARY KEY constraints) as part of a CREATE TABLE statement in PostgreSQL.

    There is no real need to do so however. If you want to make sure that the indexes are created before anybody can see (and hence use) the table then just create the table and the indexes all inside a single transaction and only commit the transaction when you are ready for the table to be used.

    That won’t work in MySQL because schema changes happen outside any transactions, even if using an engine that normally supports them. It should work in PostgreSQL though.

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

Sidebar

Related Questions

Basically, I just want to know if its possible to use Nhibernate to migrate
Just want to know how to read an attribute of a parent node from
I just want to clarify one thing. This is not a question on which
I want to migrate my existing desktop Windows .NET 3.5 app. that uses MySQL
An existing web application I want to migrate to the Windows Azure Cloud authenticates
I want to migrate sourcecode from SVN to TFS2010 using the TFS Integration Platform.
We currently have an existing ASP.NET application that we want to migrate to DNN.
Im new with Maven and i want to migrate my framework from ant to
I am trying to migrate a table from a remote server into my local
I have just managed to migrate a pretty big database from SQL Server to

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.