Summary:
The recent change in D40499 wraps the schema detail gathering code in a `PG_TRY/PG_CATCH` block. Previously, spi_execute would raise a catalog mismatch error and automatically retry. However, after this modification, the error is caught by PG_CATCH, and no retry occurs, causing the `checkSchemaDetailsData` test to fail.
To resolve this, the current diff introduces a function to refresh the cache before executing spi_execute. This ensures the schema details are up-to-date, preventing catalog mismatch errors.
Jira: DB-13564
Test Plan: ./yb_build.sh --java-test 'org.yb.pgsql.TestYbQueryDiagnostics#checkSchemaDetailsData'
Reviewers: asaha
Reviewed By: asaha
Subscribers: yql
Differential Revision: https://phorge.dev.yugabyte.com/D40622