We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5bba30d commit 59da05dCopy full SHA for 59da05d
sqlx-postgres/src/connection/describe.rs
@@ -526,8 +526,19 @@ WHERE rngtypid = $1
526
let mut tx = self.begin().await?;
527
528
if params_len > 0 {
529
- tx.execute("set local plan_cache_mode = force_generic_plan;")
530
- .await?;
+ tx.execute(
+ " DO $$
531
+ BEGIN
532
+ IF EXISTS (
533
+ SELECT 1
534
+ FROM pg_settings
535
+ WHERE name = 'plan_cache_mode'
536
+ ) THEN
537
+ SET LOCAL plan_cache_mode = 'force_generic_plan';
538
+ END IF;
539
+ END $$;",
540
+ )
541
+ .await?;
542
543
explain += "(";
544
0 commit comments