Re: massive quotes? - Mailing list pgsql-hackers

From Jon Jensen
Subject Re: massive quotes?
Date
Msg-id Pine.LNX.4.50.0309111129350.1831-100000@louche.swelter.net
Whole thread Raw
In response to Re: massive quotes?  (Doug McNaught <doug@mcnaught.org>)
Responses Re: massive quotes?
List pgsql-hackers
On Thu, 10 Sep 2003, Doug McNaught wrote:

> But Perl/DBI does escaping for you, so all you'd have to do is:
> 
> $sth = $dbh->prepare
>    ("CREATE FUNCTION foo(x text) RETURNS text AS ? LANGUAGE 'plpgsql'");
> $sth->execute($function_body);
> 
> where $function_body is the unescaped form of the function.  So
> there's no need for a COPY-style mechanism, you can use the current
> CREATE FUNCTION syntax without having to escape everything yourself.

Right; I'm not saying there's no reasonable way to deal with it in DBI
right now. I think the biggest benefit to a block-string quoting mechanism
is for scripts to feed to psql, but would prefer having a consistent SQL
solution that I could use when desired in libpq/DBI for times I build the
entire SQL statement in a string and call it with do().

Jon


pgsql-hackers by date:

Previous
From: Andreas Pflug
Date:
Subject: Re: massive quotes?
Next
From: Christopher Browne
Date:
Subject: Re: Another small bug (pg_autovacuum)