Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: reset search_path after loading demo data to prevent migration errors (#17166)

Danny Xub3b326b1f3f2
diff --git a/backend/demo/demo.go b/backend/demo/demo.go
index 645559db8a..7baccfe39d 100644
--- a/backend/demo/demo.go
+++ b/backend/demo/demo.go
@@ -44,6 +44,13 @@ func LoadDemoData(ctx context.Context, db *sql.DB) error {
return err
}
+ // Reset the search_path to public after loading demo data
+ // The dump.sql contains pg_catalog.set_config('search_path', '', false) which
+ // clears the search_path for the session, causing subsequent queries to fail
+ if _, err := db.Exec("SET search_path TO public"); err != nil {
+ return err
+ }
+
slog.Info("Completed demo data setup.")
return nil
}