Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

Re: Avoiding bad prepared-statement plans.


  • From: Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
  • To: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
  • Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jeroen Vermeulen <jtv(at)xs4all(dot)nl>, Greg Stark <gsstark(at)mit(dot)edu>, Bart Samwel <bart(at)samwel(dot)tk>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
  • Subject: Re: Avoiding bad prepared-statement plans.
  • Date: Sun, 28 Feb 2010 09:18:26 +0100
  • Message-id: <m2hbp1ydrh.fsf@hi-media.com> <text/plain>

Craig Ringer <craig(at)postnewspapers(dot)com(dot)au> writes:
> 1) People preparing statements to save on parse+plan time; and
> 2) People preparing statements to get convenenient param placement.
>
> I suspect that most of (1) also want (2), but many of (2) don't care much
> about (1) and are just preparing statements for sql-injection safety (param
> placement), because they've been told to by someone, because their library
> does it for them, etc.
>
> So: Would it be easier to handle control of replan vs no-replan at PREPARE
> time? Or would that have very much the same protocol/pl change issues?

  http://www.postgresql.org/docs/8.4/static/libpq-exec.html#LIBPQ-EXEC-MAIN

  PQexecParams

   Submits a command to the server and waits for the result, with the
   ability to pass parameters separately from the SQL command text.

So I think what you're talking about is already in there.
-- 
dim



Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group