Skip to content

Server configuration and authentication

Configure the listener, database, dialect, password exchange and TLS.

SQL object index

Look up a function overload, operator, type or MySQL metadata relation by its installed signature. pg_mysql 1.0 object index

Inspect the running server

Use native psql as the administrator. These are the 14 PostgreSQL settings registered by pg_mysql 1.0. boot_val is the compiled default, setting the effective value in this backend. A MySQL @@ variable belongs to a different namespace. For example, SELECT @@max_allowed_packet reports the packet limit, while the PostgreSQL configuration entry has the mysql. prefix.

SELECT name, boot_val, setting, unit, context, pending_restart
FROM pg_settings WHERE name LIKE 'mysql.%' ORDER BY name;

Cluster settings requiring restart

ParameterDefault and accepted valuesEffect
mysql.listener_onon, booleanEnables the MySQL TCP listener when the module is preloaded. Set off to stop accepting connections on this protocol at the next start.
mysql.port3306, integer 0–655350 disables the listener. The native PostgreSQL port defaults to 5432.
mysql.listen_addressesUnset. Comma-separated host names or IP addresses, or *Unset or empty inherits PostgreSQL listen_addresses. An empty inherited list disables TCP. Bind a specific interface for application access.
mysql.auth_cache_size1024, integer 0–1000000 entriesShared fast-auth cache capacity in users. At 0 each password login uses full authentication.
mysql.rsa_private_key_filemysql_rsa_private_key.pem, file pathRSA private key for full authentication without TLS. Relative paths start at the data directory. An OpenSSL build generates a missing key. An empty path disables RSA key loading.
mysql.auto_create_extensionon, booleanOn the first authenticated MySQL superuser connection, install the SQL extension if missing, before reporting login success. An ordinary user needs it installed already. Standbys and binary upgrade suppress automatic installation.

Cluster settings applied by reload

Edit the active configuration and run SELECT pg_reload_conf(); in an administrative PostgreSQL session. Reconnect to verify handshake settings and the target database.

ParameterDefault and accepted valuesWhen a client sees it
mysql.databasepostgres, PostgreSQL database nameNew connections bind to this database. Create it and install the extension there first. Existing connections stay in their original database.
mysql.compat_version5.7.32-log, stringReloadable major.minor.patch with an optional -suffix. The handshake, VERSION() and @@version return the full string. The numeric part determines the handshake collation and which versioned comments execute. An invalid value leaves the active version in effect on reload.
mysql.default_authentication_plugincaching_sha2_password or mysql_clear_password, default the formerAdvertised at the next login. The server checks the role’s PostgreSQL credentials.
mysql.max_allowed_packet67108864, integer 1024–1073741823 bytesLimit for an incoming MySQL message or accumulated prepared-statement long data. Read the effective limit with SELECT @@max_allowed_packet.
mysql.deadlock_timeout50ms, 0–2147483647 msDynamic default for MySQL sessions. A positive value also defaults log_lock_waits to off. Zero inherits PostgreSQL defaults. Explicit PostgreSQL server, role, database and session settings take precedence.

If reloading mysql.compat_version changes which ? placeholders occur in an executable comment, the next execution of that prepared statement returns error 1615 (HY000). Prepare it again and bind the parameters for the new version. Statements with the same parameter positions can continue on the existing connection.

Session settings

ParameterDefault and accepted valuesScope
mysql.parsermysql (default), postgres; postgresql is an aliasSelects the grammar for subsequent queries arriving over the MySQL protocol. The connection still returns MySQL packets. Native connections use the PostgreSQL parser.
mysql.statement_rollbackon, booleanInside a MySQL transaction, an ordinary statement error rolls back to a hidden savepoint. With off an error can abort the transaction. Deadlocks and serialization failures require a full transaction retry.
mysql.default_collationcase_insensitive (default), string. Also accepts case_sensitive, ignore_accents, MySQL collation names and default or empty for database defaultDefault used by subsequent MySQL DDL for character columns without an explicit column or table collation. MySQL names follow the dialect mapping. Existing columns keep their definitions.

An application can set session options for its connection. For example, in mysql, switch parsers, issue PostgreSQL SQL over the same socket, then switch back.

SELECT set_config('mysql.parser', 'postgres', false);
SELECT current_database(), 42::integer;
SELECT set_config('mysql.parser', 'mysql', false);

Admit a client

Once the listener is up, authentication depends on the target PostgreSQL database, role, TLS and HBA match. Configure passwords, HBA and TLS

Where to find the schemas

Connect with native psql to the database named in mysql.database. Application schemas sit alongside the extension schemas. A connection to a different native database has its own catalogs and installed extensions.

Object counts, SQL signatures and source definitions from one fresh installation of pg_mysql 1.0 on Mimus 19.0.1.