Skip to content

fix: [#768] Posgres DB ERROR: cached plan must not change result type#64

Merged
hwbrzzl merged 2 commits intomasterfrom
bowen/#768
Sep 7, 2025
Merged

fix: [#768] Posgres DB ERROR: cached plan must not change result type#64
hwbrzzl merged 2 commits intomasterfrom
bowen/#768

Conversation

@hwbrzzl
Copy link
Copy Markdown
Contributor

@hwbrzzl hwbrzzl commented Sep 6, 2025

📑 Description

Closes goravel/goravel#768

This pull request introduces a configuration change to the PostgreSQL driver to improve support for database migrations. The most important change is the addition of the PreferSimpleProtocol: true setting, which prevents errors during migrations at the cost of a slight performance decrease.

Database migration support:

  • In the fullConfigToDialector function in postgres.go, set PreferSimpleProtocol: true in the PostgreSQL driver configuration to avoid "cached plan must not change result type" panics during schema migrations.

Before:

image image

After:

image

✅ Checks

  • Added test cases for my code

Copilot AI review requested due to automatic review settings September 6, 2025 13:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a PostgreSQL driver issue where migrations fail with "cached plan must not change result type" errors by configuring the driver to use simple protocol mode.

  • Adds PreferSimpleProtocol: true to PostgreSQL driver configuration
  • Includes explanatory comments about the trade-off between performance and migration stability

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread postgres.go Outdated
Comment thread postgres.go Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@hwbrzzl hwbrzzl merged commit defb46f into master Sep 7, 2025
5 checks passed
@hwbrzzl hwbrzzl deleted the bowen/#768 branch October 4, 2025 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Posgres DB ERROR: cached plan must not change result type (SQLSTATE 0A000)

2 participants