Re: plpython function problem workaround - Mailing list pgsql-general

From Tom Lane
Subject Re: plpython function problem workaround
Date
Msg-id 13832.1110815662@sss.pgh.pa.us
Whole thread Raw
In response to Re: plpython function problem workaround  (Michael Fuhr <mike@fuhr.org>)
Responses Re: plpython function problem workaround
List pgsql-general
Michael Fuhr <mike@fuhr.org> writes:
> Are there any problems with doing this?  Is a VALIDATOR function
> permitted to modify the function it's validating?

Well, it's not *supposed* to, but the tuple is already stored so I
guess an UPDATE on it will work.  At the moment.

> This wouldn't work if plpythonu ever installs a VALIDATOR, but you
> might be able to use it until such time (barring objections about why
> it's a Bad Idea, that is).

The proposed hack seems far too simplistic to me ... what of CRs that
are deliberately included in string literals?

I don't know Python at all, so I don't know how complicated its lexical
structure is, but ISTM you'd at least need enough smarts to distinguish
literals from unquoted whitespace.

The other small fly in the ointment is that when the server is running
on Windows, I suppose we would have to *put in* rather than remove CRs.
Sim probably doesn't care about that case, but we couldn't accept an
official patch that doesn't handle it.

            regards, tom lane

pgsql-general by date:

Previous
From: "Rick Schumeyer"
Date:
Subject: Re: prelimiary performance comparison pgsql vs mysql
Next
From: Richard Huxton
Date:
Subject: Re: prelimiary performance comparison pgsql vs mysql