How to use EMS DB Comparer for PostgreSQL to move db structure from master to target including FK

Posted on 2007-09-28
Last Modified: 2013-12-12

I've posted a similar question before, but didn't get much of a response.  I'm  in my second trial of EMS DB Comparer for PostgreSQL (as well trying the rest of the EMS PostgreSQL studio).  I've run into problems with trying to copy the database structure from a master to target database when the master has foreign keys.  The program seems to have a bug (which the company says they are working on fixing) that always includes the foreign keys in the script it generates, even if I say I don't want it to include them.  

According to the company's website, all sorts of  top company's & governmental orgs use their software, so I am assuming someone out there must have found a good way around this problem without having to hand arrange all of the table declarations by hand in the script.

If anyone has any advice or tips, I would greatly appreciate it!

Question by:courtenayt
    LVL 10

    Accepted Solution


    You could copy the schema using pg_dump:
    pg_dump -s dbname > dbname_schema_copy.sql

    pd_dump is part of the PostgreSQL system, so you don't need
    additional tools like EMS Studio or whatever.

    LVL 1

    Author Comment


    Thanks for the alternate solution.  I've been working with EMS, and they are fixing the bugs in their program.  It's great to have a "backup" to them though - pardon the pun!


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Workplace bullying has increased with the use of email and social media. Retain evidence of this with email archiving to protect your employees.
    Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
    The viewer will learn how to back up with the free utility from runtime software, DriveImageXML using Windows 8. Download DriveImageXML from Open folder where it was saved: Start installation by double clicking the install scrip…
    The viewer will learn how to successfully download and install the SARDU utility on Windows 8, without downloading adware.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now