1

I have a PostgreSQL function with Language plpgsql. Since the EXPLAIN ANALYZE VERBOSE for my function executed like this:

EXPLAIN ANALYZE VERBOSE SELECT foo()

doesn't seem to log any valuable details except the following:

"Result (cost=0.00..5.25 rows=1000 width=32) (actual time=122.115..122.204 rows=25 loops=1)"
" Output: postgre.foo()"
"Planning time: 0.026 ms"
"Execution time: 122.243 ms"

I wanted to know if there is any way I can see the real query\queries used by the function, so that I can do EXPLAIN ANALYZE on these SQL queries.

Thanks.

asked May 11, 2018 at 4:02

1 Answer 1

-1

In psql just do \sf name_of_function and it will show you the source code. Or \ef will load it into an editor.

answered May 11, 2018 at 17:03
1
  • Why the downvote? This answers the question of how to see the real query Commented May 11, 2018 at 22:18

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.