Re: DBD::PgSQL: More Queestions - Mailing list pgsql-interfaces

From Rudy Lippan
Subject Re: DBD::PgSQL: More Queestions
Date
Msg-id Pine.LNX.4.44.0211200839150.6288-100000@elfride.ineffable.net
Whole thread Raw
In response to Re: DBD::PgSQL: More Queestions  (Tim Bunce <Tim.Bunce@pobox.com>)
Responses Re: DBD::PgSQL: More Queestions  (Tim Bunce <Tim.Bunce@pobox.com>)
List pgsql-interfaces
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




pgsql-interfaces by date:

Previous
From: Tim Bunce
Date:
Subject: Re: DBD::PgSQL: More Queestions
Next
From: Tim Bunce
Date:
Subject: Re: :PgSQL: More Queestions