Tom Lane wrote:

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.

This is perfectly true for pgAdmin2/3 and probably most other tools. If using the create dialogs from pgAdmin3, you simply don't bother about that extra quotes because they are added as appropriate.
Reducing quotes would be helpful for scripts containing function definitions, but it's obviously not a good idea to have a client executing such a script let it interpret to determine which part goes into the query execute interface and which part needs to use another.
Why not regard anything between "AS" and LANGUAGE as source? This would prevent the usage of LANGUAGE as a keyword inside the function definition, but I can't think of any senseful other use anyway.


Regards,
Andreas



---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Reply via email to