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

From Gregory Stark
Subject Re: Prepared statements considered harmful
Date
Msg-id 87lkp45wyg.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: Prepared statements considered harmful  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: Prepared statements considered harmful
List pgsql-hackers
Martijn van Oosterhout <kleptog@svana.org> writes:

> > Then you would be going very much against the user's expectations. 
> > 
> > Driver interfaces expose very clearly to the user an explicit interface to
> > prepare and execute a query separately. What your proposing is to go behind
> > the user's back and do what he's gone out of his way to tell you not to do.
> > You can always choose to prepare your queries immediately before use. Most
> > drivers even supply an interface to do so in a single step for convenience.
> 
> Is that really so? Under Perl DBI, the only way to get a statement
> handle is to "prepare" it. 

Sure, but you can prepare it right before you use it and throw it away instead
of keeping it around.

The server has to prepare the query sometime. The v3 protocol just gives you
control over when that happens, but it doesn't force you to do it at any
particular time.


-- 
greg



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Win32 hard crash problem
Next
From: Dave Page
Date:
Subject: Re: Win32 hard crash problem