Skip site navigation (1) Skip section navigation (2)

Re: proof concept: do statement parametrization

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: proof concept: do statement parametrization
Date: 2010-07-04 16:25:18
Message-ID: 20100704162518.GA9606@anarazel.de (view raw or flat)
Thread:
Lists: pgsql-hackers
On Sun, Jul 04, 2010 at 11:38:47AM -0400, Andrew Dunstan wrote:
>
>
> Pavel Stehule wrote:
> >>BTW, we intentionally didn't put any provision for parameters into DO
> >>originally.  What's changed to alter that decision?
> >>
> >
> >It just concept - nothing more. And my instinct speak so inline code
> >block without external parametrization is useless.
> >
> >
>
> You have said this before, IIRC, but frankly your instinct is just
> wrong. It is no more useless than are parameter-less functions, and
> I use those frequently. I used a DO block for some useful testing
> just the other day.
In my opinion its even *more* useful than parameterless
functions. In many cases you will use DO to write upgrade scripts or
ad-hoc code.
In both cases its not really much of diference whether you write the
parameter inside the function or outside (as a parameter to it) and
escaping is not a critical part anyway.

So maybe I am missing the point of this discussion?

Andres

In response to

Responses

pgsql-hackers by date

Next:From: Pavel StehuleDate: 2010-07-04 16:41:15
Subject: Re: proof concept: do statement parametrization
Previous:From: Tom LaneDate: 2010-07-04 16:22:32
Subject: Re: proof concept: do statement parametrization

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group