Re: plpython function problem workaround

Поиск
Список
Период
Сортировка
От David
Тема Re: plpython function problem workaround
Дата
Msg-id 20050315133305.GA6529@localhost.localdomain
обсуждение исходный текст
Ответ на Re: plpython function problem workaround  ("Sim Zacks" <sim@compulab.co.il>)
Ответы Re: plpython function problem workaround  (Ragnar Hafstað <gnari@simnet.is>)
Список pgsql-general
On Tue, Mar 15, 2005 at 08:09:47AM +0200, Sim Zacks wrote:
> I don't think that this type of solution should be discussed as an official
> patch.
> If it was, I would recommend solving the problem in source code when the
> function is passed to the translator. That way each platform could fix the
> code to work with as is needed and the code would be portable.
>
> I ran into this problem about half a year ago and it didn't go anywhere,
> then I saw a long discussion about it that also didn't go anywhere. I had
> given up on using plpython until now because I actually need it.

I'd like to insert one note here.  While I'm not particularly familiar
with either perl or python, when I encountered the referred-to thread
regarding Windows/Unix newline incompatibilities in Python, I ran some
tests on my Linux system.  I wrote some very simple scripts in Perl and
Python and tested them.  They ran OK when I saved them in native Linux
newlines, they ran, but if I saved them in DOS mode (vim), neither the
Python nor the Perl scripts would run.  I noted that some of the writers
in that thread were critical of Python for not taking care of the
conversions, and it may be that the Perl interfaces in postgresql may
take care of this, I have not tried this, but it seems that my tests, if
valid, indicate that this problem is not restricted to Python alone as
far as the interpreters are concerned.

This observation may have nothing to do with the pl/Perl and pl/Python
interfaces, but I thought I'd pass this along FWIW.

> So I
> figured out how to make it work and thought that it would be helpful to
> others, but I couldn't figure out how to automate the fix.
>
> "Tom Lane" <tgl@sss.pgh.pa.us> wrote in message

> > 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.

В списке pgsql-general по дате отправления:

Предыдущее
От: tony
Дата:
Сообщение: Re: Localization problems between Access and PostgresSQL
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Filesystem level backup and 32 / 64 bit