Mimic parse bind execute in psql?

Started by Jeremy Finzelover 8 years ago2 messagesgeneral
Jump to latest
#1Jeremy Finzel
finzelj@gmail.com

If I want to mimic a log statement that is from an application that uses
PARSE/BIND/EXECUTE, is there any way to mimic this behavior in psql, for
example to troubleshoot execution plans, other than writing a named
prepared statement, or manually subbing the parameters?

It would be nice to take the commands just as in they appear in the log
files and execute them in psql as PARSE .... BIND ... EXECUTE. Perhaps I'm
missing something?

Thanks,
Jeremy

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Jeremy Finzel (#1)
Re: Mimic parse bind execute in psql?

Jeremy Finzel <finzelj@gmail.com> writes:

If I want to mimic a log statement that is from an application that uses
PARSE/BIND/EXECUTE, is there any way to mimic this behavior in psql, for
example to troubleshoot execution plans, other than writing a named
prepared statement, or manually subbing the parameters?

psql hasn't any way to do that. You might consider pgbench as a
possible substitute though --- not only can it do PARSE/BIND/EXECUTE,
but you can insert appropriate parameter values via variables.

regards, tom lane