From 84c89a83b886c0f041b46dbf825497be2bd33040 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Mon, 5 Jan 2026 12:04:02 +0100 Subject: [PATCH 1/2] fix: disable prepared statements for PgBouncer compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add PDO::ATTR_EMULATE_PREPARES option to prevent "cached plan must not change result type" errors during rolling deployments with PgBouncer. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- config/database.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/database.php b/config/database.php index a40987de8..cd27454ab 100644 --- a/config/database.php +++ b/config/database.php @@ -48,6 +48,9 @@ 'prefix_indexes' => true, 'search_path' => 'public', 'sslmode' => 'prefer', + 'options' => [ + PDO::ATTR_EMULATE_PREPARES => true, + ], ], 'testing' => [ From 3eacaa325bfcda7e5167ab7c9786dece770fa3b7 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Mon, 5 Jan 2026 13:16:28 +0100 Subject: [PATCH 2/2] fix: make PgBouncer prepared statement disabling configurable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use PDO::PGSQL_ATTR_DISABLE_PREPARES with DB_DISABLE_PREPARES env variable to prevent "cached plan must not change result type" errors during rolling deployments with PgBouncer. Defaults to false for normal operation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- config/database.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/database.php b/config/database.php index cd27454ab..366ff90b5 100644 --- a/config/database.php +++ b/config/database.php @@ -49,7 +49,7 @@ 'search_path' => 'public', 'sslmode' => 'prefer', 'options' => [ - PDO::ATTR_EMULATE_PREPARES => true, + PDO::PGSQL_ATTR_DISABLE_PREPARES => env('DB_DISABLE_PREPARES', false), ], ],