Skip to content

Protocol, dialect and origins

Follow a connection into PostgreSQL and identify the matching kernel, extension and original authors.

From TCP connection to table

Patch 300 imports the OpenHalo server hooks. At startup the preloaded extension registers a TCP listener. On connection, a PostgreSQL backend exchanges a MySQL handshake, chooses the native database configured in mysql.database and authenticates the PostgreSQL role. It checks for the extension in that database before accepting application SQL. The database name sent by the client selects a schema inside it. 300/301 kernel patches

Parsing and execution

The extension implements the MySQL grammar, rewrites supported DDL and DML, implements compatibility types and functions, and encodes results in MySQL packets. PostgreSQL plans and executes the query and stores its rows. Patch 301 integrates dialect-specific coercions, managed collation callbacks, foreign-key checks and startup requirements. A native client uses the PostgreSQL protocol and parser against the same catalogs. SQL behavior at each endpoint

Names in the native database

The example MySQL database app maps to schema app. The extension installs its own schemas too: mysql for compatibility objects, mys_informa_schema for information-schema compatibility, performance_schema and mys_sys. Export application objects separately so the target installer can create the extension-owned objects.

Identify this build

Component19.0.1-r4 identity
Native kernelpgsty/mimus at 0d8a551aa121, tree 07fbb73680de. This integrates the nine patches on PostgreSQL REL_19_0.
OpenHalo kernel inputpgsty/openhalo at a7e6d509db7f for the upstream part of 300. 301 carries the Mimus adaptations.
Standalone extensionpgsty/pg_mysql at 1e631f9802c5, tree 53dd9be3e87b. Build this commit directly with the matching kernel’s pg_config. pg_extension.extversion and pg_get_loaded_modules() report 1.0.
MySQL protocolThe handshake, VERSION() and @@version return mysql.compat_version, which defaults to 5.7.32-log. @@version_comment returns mimus.

Origins and license

The grammar, original SQL definitions and compatibility routines descend from Halo Tech’s PostgreSQL 14 work. PGSTY ported the work to PostgreSQL 18/19 and extracted the standalone pg_mysql from OpenHalo’s aux_mysql. Ruohang Feng maintains the extension at PGSTY PTE. LTD. Earlier cross-kernel experiments belong to the OpenHalo 18 porting history. OpenHalo source · History of the earlier port

The standalone extension carries GPL-3.0-or-later and retains the original Halo Tech Co., Ltd. and openHalo.org notices, copyright 2019–2026. The parser retains Jet C.X. ZHANG’s credit. The source also credits PGSTY PTE. LTD. (2026), the PostgreSQL Global Development Group (1996–2026) and the Regents of the University of California (1994). PostgreSQL-derived portions and keyword tools retain the PostgreSQL License. The distributed LICENSE, COPYRIGHT and 3party-legal-notices contain the full notices. Original Halo Tech copyright notice

Other kernels

The examples here require Mimus 19.0.1’s matching server callbacks and module. The old experiments with IvorySQL and Babelfish used different kernels and extension identities. For SQL Server access on this Mimus kernel, use its paired Babelfish extensions. SQL Server manual · Encrypted table access methods