From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Andrew Dunstan <andrew(at)dunslane(dot)net>, Postgresql Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: massive quotes? |
Date: | 2003-09-01 16:26:43 |
Message-ID: | 200309011626.h81GQh613905@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Let me jump in --- there is the issue of how to prevent the backend from
> > running the query through the lexer/parser. The cleanest idea presented
> > was:
> > [snip]
>
> That's the same idea that was being discussed in this thread. I was
> trying to remind people of the existence of prior discussion with
> different (and IMHO better) ideas.
>
> > The interesting thing I missed at first viewing was that there is a
> > semicolon after the first line. This allows the backend to go into a
> > COPY-like mode where the client can pass lines to the backend bypassing
> > the lexer/parser.
>
> What I don't like about this scheme is that it requires mods on both the
> backend and client sides, to solve a problem that could be solved as
> well or better (and definitely more simply) on the client side alone.
> People are being misled by considering only psql, which is so stupid
> that it might actually not need any change to be used with a COPY-based
> function definition mode. I doubt that is true of any other client.
> For a client that actually understands it's doing a function definition,
> this is *not* simpler nor better. Instead of running a
> string-literal-quotify transformation on the function text (which you
> must admit is trivial), the client has to support switching into the
> COPY protocol. That's not simpler. Add in any meaningful error
> recovery (what do you do if the backend doesn't switch into COPY mode?)
> and it's substantially more complex.
I was assuming when someone executes a COPY FROM STDIN in psql, that the
backend returns something saying, "I am in COPY FROM STDIN mode, pass
all text to me until I say stop". If that's how it works, wouldn't psql
work with no changes. I am concerned about psql having to identify when
you are creating a function using the STDIN format. How would it know?
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2003-09-01 16:35:43 | Re: Unixware Patch (Was: Re: Beta2 Tag'd and Bundled ...) |
Previous Message | Pavel Stehule | 2003-09-01 15:18:13 | array constructor can't construct empty array |