Re: massive quotes?

Поиск
Список
Период
Сортировка
От Jon Jensen
Тема Re: massive quotes?
Дата
Msg-id Pine.LNX.4.50.0309111129350.1831-100000@louche.swelter.net
обсуждение исходный текст
Ответ на Re: massive quotes?  (Doug McNaught <doug@mcnaught.org>)
Ответы Re: massive quotes?  (Greg Stark <gsstark@mit.edu>)
Список 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 по дате отправления:

Предыдущее
От: Andreas Pflug
Дата:
Сообщение: Re: massive quotes?
Следующее
От: Christopher Browne
Дата:
Сообщение: Re: Another small bug (pg_autovacuum)