Procedures, Functions, and Triggers in PHP
PL/php is a procedural language with hooks into the PostgreSQL
database system, intended to allow writing of PHP functions for
use as functions inside the PostgreSQL database.
It was written by Command Prompt, Inc. and has since been open sourced and licensed under the PHP and PostgreSQL (BSD) licenses.
You can download the latest version of PL/php, including documentation, here:
A low-traffic mailing list is available here
Read the documentation here