-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DB-13678] Assess Migration command guardrails check for pgss extension properly loaded or not in source db #2018
Conversation
sanyamsinghal
commented
Nov 28, 2024
- doing SELECT query on pg_stat_statements view and comparing the error message
yb-voyager/src/srcdb/postgres.go
Outdated
// so instead of getting current_settings(), executing SELECT query on pg_stat_statements view | ||
// 3. check if its properly installed/loaded without any extra permissions | ||
_, err = pg.db.Exec(queryCheckPgssLoaded) | ||
if err != nil && strings.Contains(err.Error(), "pg_stat_statements must be loaded via shared_preload_libraries") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: error msg constant SHARED_PRELOAD_LIBRARY_ERROR
yb-voyager/src/srcdb/postgres.go
Outdated
@@ -1166,7 +1166,7 @@ const ( | |||
JOIN pg_namespace n ON e.extnamespace = n.oid | |||
WHERE e.extname = 'pg_stat_statements'` | |||
|
|||
querySharedPreloadLibraries = `SELECT current_setting('shared_preload_libraries')` | |||
queryCheckPgssLoaded = `SELECT query from pg_stat_statements LIMIT 1` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
schema of pgss table in case it's in non_public.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch.
…on properly loaded or not in source db - doing SELECT query on pg_stat_statements view and comparing the error message
d09c2e6
to
d2234a5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM