From: | Greg Stark <gsstark(at)mit(dot)edu> |
---|---|
To: | Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl> |
Cc: | Andreas Pflug <pgadmin(at)pse-consulting(dot)de>, Greg Stark <gsstark(at)mit(dot)edu>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: massive quotes? |
Date: | 2003-09-10 23:20:48 |
Message-ID: | 87znhcxmb3.fsf@stark.dyndns.tv |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl> writes:
> On Thu, Sep 11, 2003 at 01:05:47AM +0200, Andreas Pflug wrote:
>
> > A whole script containing any number of valid statements must be
> > executable without interpreting the script.
How is that relevant? It's still parseable with parameter placeholders in
place of literal parameters.
> Yes, but executable by what? You said you are a command liner. Then
> you will probably want to "execute" the script using psql. Then the
> proposed solution is fine, because the \beginliteral and \endliteral
> will be interpreted correctly.
Presumably \beginliteral \endliteral would be psql's way of specifying
parameters to ship over as parameters.
> Now, you also said you wanted to use pgAdmin to administer the database.
> Is it able to execute the complete script, or you have to fiddle around
> with the mouse? If the latter, then there's no point in trying to
> "execute" the script; and I suppose pgAdmin is already capable of taking
> an non-massively-quoted function body and quote it correctly before
> passing the CREATE FUNCTION to the server.
It probably is, but that's not what I was thinking of. I was thinking it
wouldn't have to poke around inside the string at all, it would pass it as an
out-of-band parameter using the new FE protocol.
This helps with DBI too, since you can already do that.
$dbh->do("CREATE FUNCTION foo as ? LANGUAGE SQL", $func);
Is a whole lot cleaner for the front-end to do than trying to quote the
parameters and interpolate them into a query.
--
greg
From | Date | Subject | |
---|---|---|---|
Next Message | Andrew Dunstan | 2003-09-10 23:57:24 | Re: massive quotes? |
Previous Message | Alvaro Herrera | 2003-09-10 23:14:25 | Re: massive quotes? |