0

Halo, first, i say thank you for helping me solve my problem before. I'm really newbie using Postgresql.

now i have new problem, i do select statement like this one :

select * from company where id=10;

when i see the query in pg_stat_statements, i just get the query like this : select * from company where id=?;

from the result the value of id is missing, how i can get the complete query without missing the value??

Thank you :)

1
  • 1
    You don't. pg_stat_statements doesn't record or show bind parameters. You can see it in the logs if you set log_statement = all though. Commented Nov 2, 2016 at 5:09

1 Answer 1

1

Alternatively you could set log_min_duration to 0 which will lead Postgres to log every statement.

Pg_stat_statements is meant to be for stats and these are aggregated, if every lookup value would be in there the stats would be useless because it would be hard to group.

If you want to understand a query just run it with explain analyze and you will get the query plan.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.