PHPackages                             gonzalo123/pgdbsync - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. gonzalo123/pgdbsync

ActiveLibrary

gonzalo123/pgdbsync
===================

pgdbsync

2.x-dev(10y ago)51923MITPHP

Since Jan 6Pushed 10y ago2 watchersCompare

[ Source](https://github.com/gonzalo123/pgdbsync)[ Packagist](https://packagist.org/packages/gonzalo123/pgdbsync)[ RSS](/packages/gonzalo123-pgdbsync/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

pgdbsync
========

[](#pgdbsync)

[![Build Status](https://camo.githubusercontent.com/d14b179877489c75099c8883ae51db0128d760d041be7c0d34db2b768a255331/68747470733a2f2f7472617669732d63692e6f72672f676f6e7a616c6f3132332f7067646273796e632e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/gonzalo123/pgdbsync)

pgdbsync allows us to track the differences in the database structure between different databases. It also create the needed script to synchronize the servers and even to run the script.

The usage of pgdbsync command line script is the following one:

```
 -c [config]
 -f [from database]
 -t [to database]
 -a [action: diff | summary | run]

```

usage examples
--------------

[](#usage-examples)

### Summary

[](#summary)

```
./pgdbsync -s web -f devel -t prod -a summary
HOST : production :: prod1
--------------------------------------------
function
 create :: WEB.hello(varchar)
tables
 create :: WEB.test
view
 create :: WEB.testview

[OK]  end process

```

### Creating diff script

[](#creating-diff-script)

```
./pgdbsync -s wf -f devel -t prod -a diff
HOST : production :: prod1
--------------------------------------------
CREATE OR REPLACE FUNCTION web.hello(item character varying)
 RETURNS character varying
 LANGUAGE plpgsql
AS $function$
DECLARE
BEGIN
 return "Hi " || item;
END;
$function$

CREATE TABLE web.test(
 test_name character NOT NULL,
 test_id integer NOT NULL,
 test_date timestamp without time zone NOT NULL,
 CONSTRAINT pk_test PRIMARY KEY (test_date)
)
TABLESPACE web;
ALTER TABLE web.test OWNER TO user;

CREATE OR REPLACE VIEW web.testview AS
 SELECT test.test_name, test.test_id, test.test_date FROM web.test WHERE (test.test_name ~~ 't%'::text);;
ALTER TABLE web.testview OWNER TO user;
[OK]  end process
executing diff script
./pgdbsync -s web -f devel -t prod -a run
HOST : production :: prod1
----------------------------------
﻿
[OK]  end process
creating diff script again
./pgdbsync -s wf -f devel -t prod1 -a diff

HOST : prododuction :: prod1
--------------------------------------------

drop function web.hello(varchar);

DROP TABLE web.test;

drop view web.testview;

[OK]  end process

```

Notes to run tests
------------------

[](#notes-to-run-tests)

To run tests locally the script asumes that:

- You have a PostgreSQL running at localhost (I'm using  for testing)
- Two empty databases called db1 and db2
- One user to login called "username" and with password "password"

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3777d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c5bcdeee0f7e214945e0d27310df0ad487e7d1ec10a8d4341dbdcabfac58f2f7?d=identicon)[gonzalo123](/maintainers/gonzalo123)

---

Top Contributors

[![gonzalo123](https://avatars.githubusercontent.com/u/39072?v=4)](https://github.com/gonzalo123 "gonzalo123 (76 commits)")[![LenzLueers](https://avatars.githubusercontent.com/u/12624502?v=4)](https://github.com/LenzLueers "LenzLueers (17 commits)")

---

Tags

db

### Embed Badge

![Health badge](/badges/gonzalo123-pgdbsync/health.svg)

```
[![Health](https://phpackages.com/badges/gonzalo123-pgdbsync/health.svg)](https://phpackages.com/packages/gonzalo123-pgdbsync)
```

###  Alternatives

[robmorgan/phinx

Phinx makes it ridiculously easy to manage the database migrations for your PHP app.

4.5k46.2M405](/packages/robmorgan-phinx)[yiisoft/yii2-queue

Yii2 Queue Extension which supports queues based on DB, Redis, RabbitMQ, Beanstalk, SQS, and Gearman

1.1k10.4M155](/packages/yiisoft-yii2-queue)[spatie/laravel-translation-loader

Store your language lines in the database, yaml or other sources

8362.9M51](/packages/spatie-laravel-translation-loader)[aura/sqlquery

Object-oriented query builders for MySQL, Postgres, SQLite, and SQLServer; can be used with any database connection library.

4572.9M34](/packages/aura-sqlquery)[laminas/laminas-db

Database abstraction layer, SQL abstraction, result set abstraction, and RowDataGateway and TableDataGateway implementations

13922.5M206](/packages/laminas-laminas-db)[envms/fluentpdo

FluentPDO is a quick and light PHP library for rapid query building. It features a smart join builder, which automatically creates table joins.

925511.7k13](/packages/envms-fluentpdo)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
