On Wed, 20 Nov 2002, Tim Bunce wrote:
> > I notice that
> > DBD::ODBC, for example, doesn't appear to do anything special with
> > regard to comments. And if comments *are* supported by DBI, and DBD::Pg
> > is doing the right thing by watching out for them, wouldn't it be
> > smarter for DBD::Pg to cut them *out* of its internal copy of the SQL
> > statement so that dbd_st_execute() doesn't also have to deal with them?
>
> Why should dbd_st_execute have to "deal" with them? The whole string
> should just be sent off to the server.
>
PostgreSQL itself does not (yet) support placeholders, so DBD::Pg emulates
them by scanning the string again in dbd_st_execute() looking for
placeholders and substituting them quoted values of what was passed to
execute().
or maybe more clearly in pseudo code:
preparse { look for :pn :0 ? type place holders. replace with :pn type placehoders.
}
execute { look for :pn type placeholders replace with for quote(valueof(:pn)) send to db.
}
-r