Re: plpython function problem workaround

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: plpython function problem workaround
Дата
Msg-id 20050314212635.GA58516@winnie.fuhr.org
обсуждение исходный текст
Ответ на Re: plpython function problem workaround  (Marco Colombo <pgsql@esiway.net>)
Ответы Re: plpython function problem workaround  (Marco Colombo <pgsql@esiway.net>)
Список pgsql-general
On Mon, Mar 14, 2005 at 08:14:42PM +0100, Marco Colombo wrote:
> On Mon, 14 Mar 2005, Michael Fuhr wrote:
>
> >Would we?  My understanding is that code passed to PyRun_String()
> >and friends must be free of line-ending CRs on all platforms, and
> >that the code that reads a "normal" Python script takes care of
> >that (i.e., normalizes line endings to be LF only).  Can anybody
> >confirm or deny?
>
> I'm not sure of that. I suspect you'll need to pass CRs on windows.

Hmmm...I think that would be inconsistent with previous reports.
For example, in the following message, the poster said that everything
(PostgreSQL, pgAdmin) was running on Windows 2003:

http://archives.postgresql.org/pgsql-interfaces/2005-02/msg00066.php

I suggested that he strip the CRs from pg_proc.prosrc and he said
it worked:

http://archives.postgresql.org/pgsql-interfaces/2005-03/msg00014.php

It's not clear that the test in the second message was run on a
Windows server (apparently pgAdmin was run on a Windows client),
but I think the beginning of the message is saying that he didn't
reply for so long because he didn't have access to a Windows server.
From that I infer that he tried my suggestion and posted the results
when he finally did get access to a customer's Windows server.  I
could be misreading that, however.

A couple of months ago Stuart Bishop brought this issue up in
python-dev.  Most of the thread is along the lines of "strip the
carriage returns":

http://mail.python.org/pipermail/python-dev/2005-January/051203.html

> If anyone manages to compile the following code on Windows...
...
> I bet on windows the first program fails and the second is ok.

Hopefully somebody will do a Windows test of the code you posted.
I'd find it bizarre that the Python code embedded in a C program
had to care whether it was running on *nix or Windows.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

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

Предыдущее
От: Robert Treat
Дата:
Сообщение: Re: PostgreSQL training
Следующее
От: David Gagnon
Дата:
Сообщение: Problem with special character (ÿ) on postgresql 7.4... getting out of idea .. please help :-)