You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When Prepared Statements are enabled in gorm (using the PrepareStmt: true attribute in gorm.Config when creating a connection), if multiple database migrations are performed, when AutoMigrate is called multiple times to add new columns in a Table the following error is observed:
main_test.go:55: Failed, got error: ERROR: cached plan must not change result type (SQLSTATE 0A000)
The issue seems related to Prepared Statements caching.
See the provided playground link for a reproducible case, more details and logs.
This error is observed when using gorm.io/gorm v1.23.10 (the latest gorm 1.x version at the moment of writing this message). This was detected when we were working in updating gorm.io/gorm v1.21.7 to v1.23.10. In v1.21.7 the issue does not seem to happen.
The text was updated successfully, but these errors were encountered:
Hi @a631807682. As you can see in the playground link the version that is being used is gorm.io/driver/postgres v1.3.10 which is currently the latest tagged version and the issue can still be reproduced.
GORM Playground Link
go-gorm/playground#523
Description
When Prepared Statements are enabled in gorm (using the
PrepareStmt: true
attribute in gorm.Config when creating a connection), if multiple database migrations are performed, when AutoMigrate is called multiple times to add new columns in a Table the following error is observed:The issue seems related to Prepared Statements caching.
See the provided playground link for a reproducible case, more details and logs.
This error is observed when using gorm.io/gorm v1.23.10 (the latest gorm 1.x version at the moment of writing this message). This was detected when we were working in updating gorm.io/gorm v1.21.7 to v1.23.10. In v1.21.7 the issue does not seem to happen.
The text was updated successfully, but these errors were encountered: