Re: Prepared statements considered harmful - Mailing list pgsql-hackers

From Zeugswetter Andreas DCP SD
Subject Re: Prepared statements considered harmful
Date
Msg-id E1539E0ED7043848906A8FF995BDA579014DBE53@m0143.s-mxs.net
Whole thread Raw
In response to Re: Prepared statements considered harmful  (Lukas Kahwe Smith <smith@pooteeweet.org>)
List pgsql-hackers
> >>> I'd wish that we reconsider when and how prepared statements are
> >>> used.  The JDBC interface and PL/pgSQL are frequently noticed
> >>> perpetrators, but the problem is really all over the place.
> >> AFAIK those are the only two places where preparation is
> the default
> >> ... what else were you thinking of?
> >
> > Perl DBI (DBD::Pg) defaults to prepared plans when connecting to a
> > version 8.0 or higher server.
> >
> > Or at least, that's the way I read the documentation.

Yea, but if you close the statement or leave the scope of the statement
variable the plan is gone. So it is doing exactly what I would expect.

It is written $stmt->prepare('select 1') what else would you expect ?
There are enough other functions to get a result without a plan sticking
around, like $db->selectrow_array ....

Andreas


pgsql-hackers by date:

Previous
From: Lukas Kahwe Smith
Date:
Subject: Re: Prepared statements considered harmful
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Prepared statements considered harmful