heroku-pg-extras icon indicating copy to clipboard operation
heroku-pg-extras copied to clipboard

command pg:bloat fails (on windows)

Open primalr opened this issue 10 years ago • 13 comments

ERROR:  syntax error at or near ";"
RAD 3:           SELECT current_setting('block_size');numeric AS bs...

primalr avatar Apr 10 '14 05:04 primalr

That seems to point to this line but the SQL text in the error does not match that line (and I can't reproduce). Are you running the latest version (run heroku plugins:update heroku-pg-extras to make sure)?

msakrejda avatar Apr 10 '14 05:04 msakrejda

  C:\metagamerscore>heroku plugins:update heroku-pg-extras
  Updating heroku-pg-extras... done

  C:\metagamerscore>heroku pg:bloat
  ERROR:  syntax error at or near ";"
  RAD 3:           SELECT current_setting('block_size');numeric AS bs...
                                                       ^


  C:\metagamerscore>

Same thing... odd... like the :: is converted to ; somehow

primalr avatar Apr 10 '14 18:04 primalr

Perhaps not coincidentally, the windows path separator is ;, no? Do other queries that use :: work for you, like pg:index-usage or pg:long-running-queries?

msakrejda avatar Apr 10 '14 18:04 msakrejda

Both pg:index-usage and pg:long-running-queries execute fine.

primalr avatar Apr 10 '14 18:04 primalr

Can you give this branch a shot? The easiest way to do that is to find your heroku config (on OS X and Linux, this is in ~/.heroku; I'm not sure where it'd be on Windows--perhaps %APP_DATA%?), go to the plugins/heroku-pg-extras subdirectory, run git remote update, and then git checkout origin/windows-pgbloat-fix-maybe.

msakrejda avatar Apr 11 '14 22:04 msakrejda

Trying this new branch gave me a different error:

ERROR: syntax error at or near "" RAD 15: SELECT 1+count(*)\8

primalr avatar Apr 17 '14 05:04 primalr

I still have the same issue in windows. I get this error "could not find a "psql" to execute". I even reinstalled both heroku and postgres on paths that don't have a space in them. Any help is much appreciated.

arunbhat avatar Aug 10 '16 01:08 arunbhat

does psql work?

jdx avatar Aug 10 '16 01:08 jdx

Yes psql works. I have been copy pasting the queries from bloat.js, index_usage.js to psql to get the statistics.

arunbhat avatar Aug 10 '16 02:08 arunbhat

in fact pg:psql works

arunbhat avatar Aug 10 '16 02:08 arunbhat

@arunbhat can you post the full error you are getting now? And the output of heroku version?

msakrejda avatar Aug 10 '16 15:08 msakrejda

Here you go:

C:\Users\abhat>heroku pg:bloat database --app revvy-gpm-sandbox could not find a "psql" to execute

C:\Users\abhat>heroku version heroku/toolbelt/3.43.9 (i386-mingw32) ruby/2.1.7 heroku-cli/5.2.34-65b16c9 (windows-386) go1.6.2 === Installed Plugins [email protected]

arunbhat avatar Aug 10 '16 15:08 arunbhat

I didn't test, but I think this will fix it https://github.com/heroku/heroku-pg/pull/13

jdx avatar Aug 10 '16 22:08 jdx