Code Monkey home page Code Monkey logo

pg_match's Introduction

pg_match

Schema Summary Comparison Tool

(c) 2022-2023 SQLEXEC LLC
GNU V3 and MIT licenses are conveyed accordingly.
Bugs can be reported @ [email protected]

Example Usage:

pg_match.py -t simplescan --Shost localhost --Sport 5414 --Suser postgres --Sdb clone_testing --Sschema sample --Thost localhost --Tport 5414 --Tuser postgres --Tdb clone_testing --Tschema clone1

Screen Shot

image

Overview

Regarding the scantype parameter (-t or --scantype), SimpleScan uses row estimates (pg_class/pg_stat_user_tables) whereas DetailedScan uses actual row count SQL. So for SimpleScan you should analyze all your schema tables beforehand or you will get a lot of differences.

Parameters

-t --scantype SimpleScan or DetailedScan
-H --Shost Source host
-P --Sport Source port
-U --Suser Source DB user
-D --Sdb Source databae
-S --Sschema Source schema
-h --Thost Target host
-p --Tport Target port
-u --Tuser Target DB user
-d --Tdb Target databae
-s --Tschema Target schema
-r --ignore_rowcounts Bypass row count check
-i --ignore_indexes Bypass index check
-f --ignore_funcs Bypass function/procedure check
-l --log log diffs to specified output file
-v --verbose verbose output (useful for debugging)
-x --print_help print help message for program

Requirements

  1. python 2.7 or above
  2. python packages: psycopg2
  3. Works on Linux and Windows.
  4. PostgreSQL versions 10+

Assumptions

Currently works for the following objects:

  • tables
  • views
  • columns
  • indexes and constraints
  • functions and procedures
  • row counts (implicit and direct)

pg_match's People

Contributors

michaeldba avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.