PHPackages                             derekchan/pg-php - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. derekchan/pg-php

ActiveLibrary[HTTP &amp; Networking](/categories/http)

derekchan/pg-php
================

An implementation of the Postgres TCP protocol in pure PHP

0.0.1(10y ago)1195LGPLPHPPHP &gt;=5.3.0

Since Aug 7Pushed 8y ago2 watchersCompare

[ Source](https://github.com/derekchan/PgPhp)[ Packagist](https://packagist.org/packages/derekchan/pg-php)[ RSS](/packages/derekchan-pg-php/feed)WikiDiscussions master Synced today

READMEChangelog (1)DependenciesVersions (2)Used By (0)

PgPhp - An implementation of the postgre protocol in pure PHP
=============================================================

[](#pgphp---an-implementation-of-the-postgre-protocol-in-pure-php)

A pure PHP PostgreSQL connector that works - sometimes you just need a quick and dirty way to connect to PostgreSQL, but for any reasons you do not have access to the native driver, and you do not care about performance.

*Currently only works in Linux / UNIX-like environment as it depends on "/usr/bin/hexdump"*

### Usage

[](#usage)

See [examples.php](examples.php)

### Installation

[](#installation)

```
composer require derekchan/pg-php

```

From the original author (@BraveSirRobin)
-----------------------------------------

[](#from-the-original-author-bravesirrobin)

### Development status

[](#development-status)

Development status : Toy. Works for me, and it supports the protocol COPY command too, which is nice.

### Motivation

[](#motivation)

I wrote this library as a proof of concept and to learn a bit more about different TCP protocols. The main (only?) reason for wanting to do this is to be able to write an "Event Machine" / "Twisted" type of server where you can do asynchronous I.O. to several different kinds of application endpoint, e.g. RabbitMQ, Postgres, MySql, HTTP, etc. etc.

### Future

[](#future)

Currently, and for the forseeable future I'll be devoting my "open source" time to my [Amqphp project](https://github.com/BraveSirRobin/amqphp), but eventually I'd like to expand this to be a fast, fully asyncronous, PHP-implemented "business process server".

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85% 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

3983d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8f12e8c826c01f15e4e20eb202ae22d2481020f8580e28805ea46a20778033f8?d=identicon)[derekchan](/maintainers/derekchan)

---

Top Contributors

[![BraveSirRobin](https://avatars.githubusercontent.com/u/549224?v=4)](https://github.com/BraveSirRobin "BraveSirRobin (34 commits)")[![derek9gag](https://avatars.githubusercontent.com/u/14237112?v=4)](https://github.com/derek9gag "derek9gag (4 commits)")[![derekchan](https://avatars.githubusercontent.com/u/1776133?v=4)](https://github.com/derekchan "derekchan (2 commits)")

### Embed Badge

![Health badge](/badges/derekchan-pg-php/health.svg)

```
[![Health](https://phpackages.com/badges/derekchan-pg-php/health.svg)](https://phpackages.com/packages/derekchan-pg-php)
```

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25126.1M82](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.9M6.9k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k24.3k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87965.9k114](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.4M91](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69127.2k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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