Re: massive quotes?

Поиск
Список
Период
Сортировка
От Doug McNaught
Тема Re: massive quotes?
Дата
Msg-id m3brtsdq9p.fsf@varsoon.wireboard.com
обсуждение исходный текст
Ответ на Re: massive quotes?  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: massive quotes?  (Jon Jensen <jon@endpoint.com>)
Список pgsql-hackers
Jon Jensen <jon@endpoint.com> writes:

> On Wed, 10 Sep 2003, Alvaro Herrera wrote:
> 
> > On Wed, Sep 10, 2003 at 10:35:18PM +0200, Andreas Pflug wrote:
> > 
> > > I never agreed that a client solution would be satisfying. While 
> > > frontends might try to hide some uglyness of the syntax to the user for 
> > > single functions, editing large scripts with many functions is still 
> > > suffering from "massive quotes".
> > 
> > Oh, and you will be feeding those script to the backend through what?
> 
> I don't know what he'd be using, but I use Perl/DBI for things like that. 
> Sure, I could spawn psql instances, but it's a lot less efficient and is 
> quite different from using DBI directly.

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.
The same argument applies to JDBC.

-Doug


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Ron Mayer"
Дата:
Сообщение: Re: Broken(?) 'interval' problems. [Was: ISO 8601 "Time Intervals"]
Следующее
От: Tom Lane
Дата:
Сообщение: Re: massive quotes?