Re: DBD::PgSQL: More Queestions

From: Rudy Lippan <rlippan(at)remotelinux(dot)com>
To: Tim Bunce <Tim(dot)Bunce(at)pobox(dot)com>
Cc: David Wheeler <david(at)wheeler(dot)net>, <dbi-dev(at)perl(dot)org>, <pgsql-interfaces(at)postgresql(dot)org>
Subject: Re: DBD::PgSQL: More Queestions
Date: 2002-11-20 13:58:59
Message-ID: Pine.LNX.4.44.0211200839150.6288-100000@elfride.ineffable.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Tim Bunce 2002-11-20 14:53:01 Re: :PgSQL: More Queestions
Previous Message Tim Bunce 2002-11-20 10:49:50 Re: DBD::PgSQL: More Queestions