Re: plpython function problem workaround

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Marco Colombo <pgsql(at)esiway(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: plpython function problem workaround
Date: 2005-03-14 21:26:36
Message-ID: 20050314212635.GA58516@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Gagnon 2005-03-14 21:32:38 Problem with special character (ÿ) on postgresql 7.4... getting out of idea .. please help :-)
Previous Message Robert Treat 2005-03-14 20:51:41 Re: PostgreSQL training