cli icon indicating copy to clipboard operation
cli copied to clipboard

fix (pg-v5): Look for pg_stat_statements in heroku_ext

Open verajohne opened this issue 2 years ago • 0 comments

Following https://devcenter.heroku.com/changelog-items/2446

We need to also include heroku_ext here.

Testing on a new db:

ds9aic4ustc1f=> SELECT exists(
  SELECT 1 FROM pg_extension e LEFT JOIN pg_namespace n ON n.oid = e.extnamespace
  WHERE e.extname='pg_stat_statements' AND n.nspname = 'public'
);
 exists 
--------
 f
(1 row)

ds9aic4ustc1f=> SELECT exists(
  SELECT 1 FROM pg_extension e LEFT JOIN pg_namespace n ON n.oid = e.extnamespace
  WHERE e.extname='pg_stat_statements' AND n.nspname = 'heroku_ext'
);
 exists 
--------
 t
(1 row)

ds9aic4ustc1f=> SELECT exists(
  SELECT 1 FROM pg_extension e LEFT JOIN pg_namespace n ON n.oid = e.extnamespace
  WHERE e.extname='pg_stat_statements' AND n.nspname IN ('heroku_ext', 'public')
);
 exists 
--------
 t
(1 row)

verajohne avatar Aug 15 '22 20:08 verajohne