Skip to content

pg_mysql

A PostgreSQL extension for launching MySQL servers from within PostgreSQL

pg_mysql · A PostgreSQL extension for launching MySQL servers from within PostgreSQL

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
101585pg_mysqlpg_mysql1.0SIMApache-2.0C

Usage

Sources:

pg_mysql — Production-grade replication for PostgreSQL - at last! Use it when porting or emulating the corresponding database API. Use the pinned upstream revision linked above as the API boundary and test it on the target PostgreSQL build.

Core Workflow

CREATE EXTENSION pg_mysql;

Install the extension in the intended database, run the smallest upstream example above when available, and verify the installed version and returned values before integrating it into application SQL.

Important Objects

  • mysql.delete(port integer) is an extension function and returns text.
  • mysql.query(sql text, port integer DEFAULT 0) is an extension function and returns text.
  • mysql.start(port integer DEFAULT 0, semi_sync boolean DEFAULT false) is an extension function and returns mysql.
  • mysql.start_replica(source_host text, source_port integer, port integer DEFAULT 0, semi_sync boolean DEFAULT false) is an extension function and returns mysql.
  • mysql.status(port integer DEFAULT 0) is an extension function and returns SETOF.
  • mysql.stop(port integer) is an extension function and returns text.
  • mysql.start_result is an extension-defined type.
  • mysql.status_info is an extension-defined type.

Requirements and Caveats

  • The reviewed control file declares default version 1.0.
  • The control file marks the extension as non-relocatable.
  • Confirm privileges, supported PostgreSQL versions, upgrade behavior, and failure cases against the pinned source before production use.

Table reader