Re: New user: Windows, Postgresql, Python

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Paul Moore <pf_moore(at)yahoo(dot)co(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: New user: Windows, Postgresql, Python
Date: 2005-03-15 20:43:07
Message-ID: 20050315204307.GA67137@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Mar 15, 2005 at 07:05:22PM +0000, Paul Moore wrote:

> As per my earlier posting, I actually found that building postgresql
> wasn't at all hard. Once I'd built with Python 2.4 support, I had a
> compatible plpython.dll I could just copy in.

Pardon the interruption, but do you have a PostgreSQL server with
PL/Python running on Windows? Have you been following the "plpython
function problem workaround" thread?

http://archives.postgresql.org/pgsql-general/2005-03/msg00599.php

We (the thread participants) could use somebody with a Windows
server to do some testing. Specifically, we're wondering if Python
on Windows requires embedded Python code to have CRLF (\r\n) as a
line ending, or if it requires (or at least permits) LF (\n) only.
If you're able to help, could you could post the results of the
following?

CREATE FUNCTION pytest_lf() RETURNS integer AS
'x = 1\nreturn x\n'
LANGUAGE plpythonu;

CREATE FUNCTION pytest_crlf() RETURNS integer AS
'x = 1\r\nreturn x\r\n'
LANGUAGE plpythonu;

SELECT pytest_lf();
SELECT pytest_crlf();

With PostgreSQL 8.0.1, Python 2.4.1c1, and Solaris 9, I get this:

test=# SELECT pytest_lf();
pytest_lf
-----------
1
(1 row)

test=# SELECT pytest_crlf();
ERROR: plpython: could not compile function "pytest_crlf"
DETAIL: exceptions.SyntaxError: invalid syntax (line 2)

If you have the ability to compile standalone C programs with
embedded Python, we'd also be interested in seeing what happens if
you run the programs in the following messages:

http://archives.postgresql.org/pgsql-general/2005-01/msg00876.php
http://archives.postgresql.org/pgsql-general/2005-03/msg00630.php

Any test results or comments you can provide would be appreciated.
Thanks.

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Davis 2005-03-15 20:51:03 Re: prelimiary performance comparison pgsql vs mysql
Previous Message John DeSoi 2005-03-15 20:36:57 Re: Installation on XP