pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Mimic parse bind execute in psql?
2+ messages / 2 participants
[nested] [flat]

* Mimic parse bind execute in psql?
@ 2017-12-29 15:44  Jeremy Finzel <finzelj@gmail.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Jeremy Finzel @ 2017-12-29 15:44 UTC (permalink / raw)
  To: pgsql-general

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

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Mimic parse bind execute in psql?
@ 2017-12-29 16:21  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Jeremy Finzel <finzelj@gmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2017-12-29 16:21 UTC (permalink / raw)
  To: Jeremy Finzel <finzelj@gmail.com>; +Cc: pgsql-general

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




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2017-12-29 16:21 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-12-29 15:44 Mimic parse bind execute in psql? Jeremy Finzel <finzelj@gmail.com>
2017-12-29 16:21 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox