Re: Python 3.0 does not work with PL/Python

Lists: pgsql-hackers
From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Python 3.0 does not work with PL/Python
Date: 2009-01-08 09:38:26
Message-ID: 4965C992.9020408@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

I have recently fixed the configure script to recognize Python 3.0. But
note that building and running PL/Python with Python 3.0 does not
actually work. It looks like several symbols have been removed or
changed. It would be good if the Python pundits around here could take
a look.

(I have found Python 3.0 to be very quick and easy to install from
source, in case your distribution doesn't have it packaged yet.)


From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Python 3.0 does not work with PL/Python
Date: 2009-01-08 16:39:59
Message-ID: 1231432799.12947.258.camel@jd-laptop.pragmaticzealot.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, 2009-01-08 at 11:38 +0200, Peter Eisentraut wrote:
> I have recently fixed the configure script to recognize Python 3.0. But
> note that building and running PL/Python with Python 3.0 does not
> actually work. It looks like several symbols have been removed or
> changed. It would be good if the Python pundits around here could take
> a look.
>

Yeah I mentioned that to Bruce a couple of days ago. I am trying to fix
it. Or I should say, I am trying to get Alvaro to hold my hand while I
fix it.

Joshua D. Drake

> (I have found Python 3.0 to be very quick and easy to install from
> source, in case your distribution doesn't have it packaged yet.)
>
--
PostgreSQL
Consulting, Development, Support, Training
503-667-4564 - http://www.commandprompt.com/
The PostgreSQL Company, serving since 1997


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Python 3.0 does not work with PL/Python
Date: 2009-02-06 17:09:30
Message-ID: 200902061709.n16H9UG28609@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut wrote:
> I have recently fixed the configure script to recognize Python 3.0. But
> note that building and running PL/Python with Python 3.0 does not
> actually work. It looks like several symbols have been removed or
> changed. It would be good if the Python pundits around here could take
> a look.
>
> (I have found Python 3.0 to be very quick and easy to install from
> source, in case your distribution doesn't have it packaged yet.)

Any progress on this?

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Python 3.0 does not work with PL/Python
Date: 2009-02-08 22:12:06
Message-ID: 498F58B6.3010504@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Bruce Momjian wrote:
> Peter Eisentraut wrote:
>> I have recently fixed the configure script to recognize Python 3.0. But
>> note that building and running PL/Python with Python 3.0 does not
>> actually work. It looks like several symbols have been removed or
>> changed. It would be good if the Python pundits around here could take
>> a look.
>>
>> (I have found Python 3.0 to be very quick and easy to install from
>> source, in case your distribution doesn't have it packaged yet.)
>
> Any progress on this?

Won't happen for 8.4, it looks like.


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Python 3.0 does not work with PL/Python
Date: 2009-04-04 03:54:32
Message-ID: 3544.1238817272@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> I have recently fixed the configure script to recognize Python 3.0. But
> note that building and running PL/Python with Python 3.0 does not
> actually work. It looks like several symbols have been removed or
> changed. It would be good if the Python pundits around here could take
> a look.

> (I have found Python 3.0 to be very quick and easy to install from
> source, in case your distribution doesn't have it packaged yet.)

I thought I would experiment with this a bit. I got past Python's
"configure; make; make install" okay, but got no further than here
with building PG:

checking for python... /home/tgl/python3.0.1/bin/python
checking for Python distutils module... ./configure: line 6946: 21044 Aborted "${PYTHON}" -c 'import distutils' 2>&-
no
configure: error: distutils module not found
$

Okay, but some research revealed that there does not exist any
working distutils for Python 3.0.1 yet:
http://regebro.wordpress.com/2009/02/01/setuptools-and-easy_install-for-python-3/

If the language is still at the point where they're breaking fundamental
tools with each dot-release, I don't think it's really stable enough for
us to spend effort on :-(

I also found out that my favorite distro is just *starting* to think
about what it will take to migrate to Python 3, and they seem to think
that it's not going to be viable till around Fedora 13 (a year away):
https://www.redhat.com/archives/fedora-devel-list/2009-April/msg00085.html

So my conclusion is that Python 3.0 is much too wet behind the ears for
us to worry about in PG 8.4. I'd guess that we should come back to the
issue towards the end of 2009, and perhaps think about back-porting
after we have something working in 8.5.

BTW, there is some useful info here:
http://docs.python.org/3.0/howto/cporting.html
for whenever we do get around to trying to make the code work.
It looks like we'll need not-trivial code changes. But there's
no point until the language is a bit more stable.

regards, tom lane


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Python 3.0 does not work with PL/Python
Date: 2009-04-04 23:49:32
Message-ID: 20090404234932.GB4406@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:

> I thought I would experiment with this a bit. I got past Python's
> "configure; make; make install" okay, but got no further than here
> with building PG:

Consequently, I have removed the Python 3.0 item from the open items
list and added a link to this thread to the TODO item that was already
there.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


From: Marko Kreen <markokr(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Python 3.0 does not work with PL/Python
Date: 2009-04-05 07:45:10
Message-ID: e51f66da0904050045j35412e9cp48043a4764445553@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 4/4/09, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> > I have recently fixed the configure script to recognize Python 3.0. But
> > note that building and running PL/Python with Python 3.0 does not
> > actually work. It looks like several symbols have been removed or
> > changed. It would be good if the Python pundits around here could take
> > a look.
>
> > (I have found Python 3.0 to be very quick and easy to install from
> > source, in case your distribution doesn't have it packaged yet.)
>
>
> I thought I would experiment with this a bit. I got past Python's
> "configure; make; make install" okay, but got no further than here
> with building PG:
>
> checking for python... /home/tgl/python3.0.1/bin/python
> checking for Python distutils module... ./configure: line 6946: 21044 Aborted "${PYTHON}" -c 'import distutils' 2>&-
> no
> configure: error: distutils module not found
> $
>
> Okay, but some research revealed that there does not exist any
> working distutils for Python 3.0.1 yet:
> http://regebro.wordpress.com/2009/02/01/setuptools-and-easy_install-for-python-3/
>
> If the language is still at the point where they're breaking fundamental
> tools with each dot-release, I don't think it's really stable enough for
> us to spend effort on :-(

Well, the point of 3.0 was to "break the world"...

> I also found out that my favorite distro is just *starting* to think
> about what it will take to migrate to Python 3, and they seem to think
> that it's not going to be viable till around Fedora 13 (a year away):
> https://www.redhat.com/archives/fedora-devel-list/2009-April/msg00085.html
>
> So my conclusion is that Python 3.0 is much too wet behind the ears for
> us to worry about in PG 8.4. I'd guess that we should come back to the
> issue towards the end of 2009, and perhaps think about back-porting
> after we have something working in 8.5.

It is not "wet" (the new interfaces should be stable), but it is break
from 2.x series. This means that users of PL/Python should not expect
PL/Python to automatically work with 3.0. Supporting 3.0 will be a new
feature. So it's OK to drop it from 8.4.

--
marko


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Marko Kreen <markokr(at)gmail(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Python 3.0 does not work with PL/Python
Date: 2009-04-05 15:54:03
Message-ID: 4775.1238946843@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Marko Kreen <markokr(at)gmail(dot)com> writes:
> On 4/4/09, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> So my conclusion is that Python 3.0 is much too wet behind the ears for
>> us to worry about in PG 8.4. I'd guess that we should come back to the
>> issue towards the end of 2009, and perhaps think about back-porting
>> after we have something working in 8.5.

> It is not "wet" (the new interfaces should be stable), but it is break
> from 2.x series.

Hm, did you read the link I cited? It's not so surprising that 3.0
should have broken distutils, but what I found distressing is that they
fixed distutils and then 3.0.1 broke it *again*. I stand by my opinion
that Python 3 isn't stable yet.

> This means that users of PL/Python should not expect PL/Python to
> automatically work with 3.0. Supporting 3.0 will be a new feature.
> So it's OK to drop it from 8.4.

One other thing that we'll have to seriously consider is whether we
should package python3 as a separate PL, so that people can keep using
their 2.x plpython functions without fear of breakage. I know that the
Fedora guys are currently debating whether to treat it that way, and
I suppose other distros are having or will soon have the same
conversation. Six months from now, there will be some precedents and
some track record for us to look at in making that choice.

regards, tom lane


From: James Pye <lists(at)jwp(dot)name>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Marko Kreen <markokr(at)gmail(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Python 3.0 does not work with PL/Python
Date: 2009-04-05 23:10:59
Message-ID: C6AA0F09-CF1A-4D44-B745-67B529D2341C@jwp.name
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Apr 5, 2009, at 8:54 AM, Tom Lane wrote:
> Hm, did you read the link I cited? It's not so surprising that 3.0
> should have broken distutils, but what I found distressing is that
> they
> fixed distutils and then 3.0.1 broke it *again*. I stand by my
> opinion
> that Python 3 isn't stable yet.

Yeah, actually. From some of the talk I've seen on python-dev, it
sounds like 3.0.2 will be the last 3.0 release. 3.1 is in alpha, and
ready to start cleaning things up, afaict.

>> This means that users of PL/Python should not expect PL/Python to
>> automatically work with 3.0. Supporting 3.0 will be a new feature.
>> So it's OK to drop it from 8.4.
>
> One other thing that we'll have to seriously consider is whether we
> should package python3 as a separate PL, so that people can keep using
> their 2.x plpython functions without fear of breakage. I know that
> the
> Fedora guys are currently debating whether to treat it that way, and
> I suppose other distros are having or will soon have the same
> conversation. Six months from now, there will be some precedents and
> some track record for us to look at in making that choice.

I think this would be wise.

Any thoughts on the acceptability of a complete rewrite for Python 3?
I've been fiddling with a HEAD branch including the plpy code in a
github repo. (nah it dunt compile yet: bitrot and been busy with a 3.x
driver. ;)


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: James Pye <lists(at)jwp(dot)name>
Cc: Marko Kreen <markokr(at)gmail(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Python 3.0 does not work with PL/Python
Date: 2009-04-05 23:25:07
Message-ID: 4302.1238973907@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

James Pye <lists(at)jwp(dot)name> writes:
> Any thoughts on the acceptability of a complete rewrite for Python 3?

I've always thought that plpython.c was a bit on the hackish side.
If we do decide we have to make plpython2 and plpython3 separate
languages, it'd be pretty easy to just start over with a whole new
implementation for python3 ...

regards, tom lane


From: David Blewett <david(at)dawninglight(dot)net>
To: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Python 3.0 does not work with PL/Python
Date: 2009-04-30 12:10:03
Message-ID: 9d1f8d830904300510w1383d7a3pfc17eb9e04145f93@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sun, Apr 5, 2009 at 7:10 PM, James Pye <lists(at)jwp(dot)name> wrote:
> Any thoughts on the acceptability of a complete rewrite for Python 3? I've
> been fiddling with a HEAD branch including the plpy code in a github repo.
> (nah it dunt compile yet: bitrot and been busy with a 3.x driver. ;)

I'd love to see this. I can't help with the C stuff, but I can try to
help test things as you go.

David Blewett


From: David Blewett <david(at)dawninglight(dot)net>
To: James Pye <lists(at)jwp(dot)name>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Python 3.0 does not work with PL/Python
Date: 2009-04-30 12:44:43
Message-ID: 9d1f8d830904300544w5f646fd0y6d052c9ce65866ff@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Apr 30, 2009 at 8:30 AM, James Pye <lists(at)jwp(dot)name> wrote:
> On Apr 30, 2009, at 5:09 AM, David Blewett wrote:
>>
>> I'd love to see this.
>
> yep, once I get 0.9 of the driver out the door, I'll probably focus on this.
>
> It's the perfect time for a rewrite.. I really don't want to see the 2.x
> version ported. =\
>
>> I can't help with the C stuff, but I can try to
>> help test things as you go.
>
> I will probably be taking you up on that offer. =)
>
> I'll be dev'ing on osx with some occasional compiles/tests on fbsd, so an
> extra pair of eyes on builds/test runs would be a *huge* help..

I have access to the current version of ubuntu, centos 5, gentoo and
opensolaris. Just let me know what you'd like tested.

David Blewett


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Cc: James Pye <lists(at)jwp(dot)name>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Marko Kreen <markokr(at)gmail(dot)com>
Subject: Re: Python 3.0 does not work with PL/Python
Date: 2009-05-04 06:02:04
Message-ID: 200905040902.04415.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Monday 06 April 2009 02:10:59 James Pye wrote:
> Any thoughts on the acceptability of a complete rewrite for Python 3?

http://www.joelonsoftware.com/articles/fog0000000069.html


From: James Pye <lists(at)jwp(dot)name>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Marko Kreen <markokr(at)gmail(dot)com>
Subject: Re: Python 3.0 does not work with PL/Python
Date: 2009-05-04 08:18:50
Message-ID: 047AB82B-1AC8-4177-9CAC-88D506908A4E@jwp.name
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On May 3, 2009, at 11:02 PM, Peter Eisentraut wrote:
>
> http://www.joelonsoftware.com/articles/fog0000000069.html

Good read. =)

However, complete rewrite being relative in this case:

WIP: http://github.com/jwp/postgresql-plpython3/tree/c804e693b6a0df98c0e5c465e75ba2e9014ebf37/src/pl/plpython3

That is, from pgsql's perspective it would be a complete rewrite.

From my perspective it would be a refactored version of plpy for
Python 3.x and pgsql 8.5/head. Additionally, plpy originally came from
plpythonu(7.3 or 7.4), but was *massively* refactored(read:
effectively rewritten).

I wouldn't want to start from scratch, actually.


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, James Pye <lists(at)jwp(dot)name>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Marko Kreen <markokr(at)gmail(dot)com>
Subject: Re: Python 3.0 does not work with PL/Python
Date: 2009-05-28 23:36:20
Message-ID: 200905282336.n4SNaKJ08550@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut wrote:
> On Monday 06 April 2009 02:10:59 James Pye wrote:
> > Any thoughts on the acceptability of a complete rewrite for Python 3?
>
> http://www.joelonsoftware.com/articles/fog0000000069.html

You usually have to rewrite when you have not done refactoring as part
of development; PGDG does refactoring regularly.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, James Pye <lists(at)jwp(dot)name>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Marko Kreen <markokr(at)gmail(dot)com>
Subject: Re: Python 3.0 does not work with PL/Python
Date: 2009-05-29 00:53:17
Message-ID: 20090529005317.GN5156@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Bruce Momjian escribió:
> Peter Eisentraut wrote:
> > On Monday 06 April 2009 02:10:59 James Pye wrote:
> > > Any thoughts on the acceptability of a complete rewrite for Python 3?
> >
> > http://www.joelonsoftware.com/articles/fog0000000069.html
>
> You usually have to rewrite when you have not done refactoring as part
> of development; PGDG does refactoring regularly.

Except that plpython stagnates, save for minor hacks here and there.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, James Pye <lists(at)jwp(dot)name>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Marko Kreen <markokr(at)gmail(dot)com>
Subject: Re: Python 3.0 does not work with PL/Python
Date: 2009-05-29 01:06:14
Message-ID: 4A1F3506.9030703@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Alvaro Herrera wrote:
> Bruce Momjian escribió:
>
>> Peter Eisentraut wrote:
>>
>>> On Monday 06 April 2009 02:10:59 James Pye wrote:
>>>
>>>> Any thoughts on the acceptability of a complete rewrite for Python 3?
>>>>
>>> http://www.joelonsoftware.com/articles/fog0000000069.html
>>>
>> You usually have to rewrite when you have not done refactoring as part
>> of development; PGDG does refactoring regularly.
>>
>
> Except that plpython stagnates, save for minor hacks here and there.
>

Does Python 3 have some sort of usable sandbox that would mean we could
have a trusted plpython?

Otherwise, I'm not too keen simply to throw Python 2.x overboard until
it's no longer common on platforms people are likely to want to install
Postgres on, if that's what's implied by the original question.

cheers

andrew


From: Caleb Welton <cwelton(at)greenplum(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, James Pye <lists(at)jwp(dot)name>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Marko Kreen <markokr(at)gmail(dot)com>
Subject: Re: Python 3.0 does not work with PL/Python
Date: 2009-05-29 01:14:36
Message-ID: C644850C.2233%cwelton@greenplum.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

No. Still no sandbox.

-Caleb

On 5/28/09 6:06 PM, "Andrew Dunstan" <andrew(at)dunslane(dot)net> wrote:

Does Python 3 have some sort of usable sandbox that would mean we could
have a trusted plpython?

Otherwise, I'm not too keen simply to throw Python 2.x overboard until
it's no longer common on platforms people are likely to want to install
Postgres on, if that's what's implied by the original question.

cheers

andrew

--
Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, James Pye <lists(at)jwp(dot)name>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Marko Kreen <markokr(at)gmail(dot)com>
Subject: Re: Python 3.0 does not work with PL/Python
Date: 2009-05-29 08:12:05
Message-ID: 200905291112.06032.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Friday 29 May 2009 03:53:17 Alvaro Herrera wrote:
> Bruce Momjian escribió:
> > Peter Eisentraut wrote:
> > > On Monday 06 April 2009 02:10:59 James Pye wrote:
> > > > Any thoughts on the acceptability of a complete rewrite for Python 3?
> > >
> > > http://www.joelonsoftware.com/articles/fog0000000069.html
> >
> > You usually have to rewrite when you have not done refactoring as part
> > of development; PGDG does refactoring regularly.
>
> Except that plpython stagnates, save for minor hacks here and there.

But that doesn't mean that there is anything wrong with it. Of course there
is, but those are isolated problems that can be fixed when desired. For
example, it might just be that those who use it don't have use of INOUT
parameters or table returns.


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, James Pye <lists(at)jwp(dot)name>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Marko Kreen <markokr(at)gmail(dot)com>
Subject: Re: Python 3.0 does not work with PL/Python
Date: 2009-05-29 08:17:02
Message-ID: 200905291117.03245.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Friday 29 May 2009 04:06:14 Andrew Dunstan wrote:
> Otherwise, I'm not too keen simply to throw Python 2.x overboard until
> it's no longer common on platforms people are likely to want to install
> Postgres on, if that's what's implied by the original question.

My guess is that we will need to keep around a Python 2.x version for at least
another three years, meaning two or three major PostgreSQL releases.

That also means that maintaining a separate, parallel code base for a Python 3
variant can only be acceptable if it gives major advantages.


From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Python 3.0 does not work with PL/Python
Date: 2009-05-29 11:31:49
Message-ID: 20090529113149.GI5407@samason.me.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, May 28, 2009 at 09:06:14PM -0400, Andrew Dunstan wrote:
> Does Python 3 have some sort of usable sandbox that would mean we could
> have a trusted plpython?

Not sure if people are aware of object-capability based approaches to
security. A guy called Tav has come up with some code that constrains
python (i.e. you could build a sandbox out of it) and punch holes in
it where needed (i.e. you want to be able to execute queries in the
database but otherwise not, say, touch the filesystem). The most recent
description I've found is:

http://tav.espians.com/paving-the-way-to-securing-the-python-interpreter.html

--
Sam http://samason.me.uk/


From: David Blewett <david(at)dawninglight(dot)net>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, James Pye <lists(at)jwp(dot)name>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Marko Kreen <markokr(at)gmail(dot)com>
Subject: Re: Python 3.0 does not work with PL/Python
Date: 2009-05-29 11:47:16
Message-ID: 9d1f8d830905290447h65eb34a8sf12873b81bfa6b78@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, May 28, 2009 at 9:06 PM, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:

> Does Python 3 have some sort of usable sandbox that would mean we could
> have a trusted plpython?

I brought this up last August [1]. Zope has a working sandbox that they
include in their distribution.

David Blewett

1.
http://archives.postgresql.org/message-id/9d1f8d830808041008v50104fd8p6181d5ddce85a6a@mail.gmail.com


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: David Blewett <david(at)dawninglight(dot)net>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, James Pye <lists(at)jwp(dot)name>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Marko Kreen <markokr(at)gmail(dot)com>
Subject: Re: Python 3.0 does not work with PL/Python
Date: 2009-05-29 14:41:53
Message-ID: 4A1FF431.2070606@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

David Blewett wrote:
> On Thu, May 28, 2009 at 9:06 PM, Andrew Dunstan <andrew(at)dunslane(dot)net
> <mailto:andrew(at)dunslane(dot)net>> wrote:
>
> Does Python 3 have some sort of usable sandbox that would mean we
> could have a trusted plpython?
>
>
> I brought this up last August [1]. Zope has a working sandbox that
> they include in their distribution.
>
>
> 1.
> http://archives.postgresql.org/message-id/9d1f8d830808041008v50104fd8p6181d5ddce85a6a@mail.gmail.com
>

How many python installations have this gadget? If the answer is "not
many" then it's not much good to us, unless someone wants to create
PL/zope-sandbox. Really, something like this should be part of a
standard python installation.

cheers

andrew


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: David Blewett <david(at)dawninglight(dot)net>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, James Pye <lists(at)jwp(dot)name>, Marko Kreen <markokr(at)gmail(dot)com>
Subject: Re: Python 3.0 does not work with PL/Python
Date: 2009-05-29 15:38:16
Message-ID: 18344.1243611496@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> David Blewett wrote:
>> I brought this up last August [1]. Zope has a working sandbox that
>> they include in their distribution.
>> http://archives.postgresql.org/message-id/9d1f8d830808041008v50104fd8p6181d5ddce85a6a@mail.gmail.com

> How many python installations have this gadget? If the answer is "not
> many" then it's not much good to us, unless someone wants to create
> PL/zope-sandbox. Really, something like this should be part of a
> standard python installation.

Yeah. For one thing, how much trust can you put in a security mechanism
that hasn't been accepted upstream? Given the history of this sort of
thing in Python, I'm not prepared to just assume that Zope got it right.

regards, tom lane


From: Hannu Krosing <hannu(at)2ndQuadrant(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, James Pye <lists(at)jwp(dot)name>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Marko Kreen <markokr(at)gmail(dot)com>
Subject: Re: Python 3.0 does not work with PL/Python
Date: 2009-05-29 21:25:55
Message-ID: 1243632355.5399.26.camel@huvostro
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, 2009-05-29 at 11:12 +0300, Peter Eisentraut wrote:
> On Friday 29 May 2009 03:53:17 Alvaro Herrera wrote:
> > Bruce Momjian escribió:
> > > Peter Eisentraut wrote:
> > > > On Monday 06 April 2009 02:10:59 James Pye wrote:
> > > > > Any thoughts on the acceptability of a complete rewrite for Python 3?
> > > >
> > > > http://www.joelonsoftware.com/articles/fog0000000069.html
> > >
> > > You usually have to rewrite when you have not done refactoring as part
> > > of development; PGDG does refactoring regularly.
> >
> > Except that plpython stagnates, save for minor hacks here and there.
>
> But that doesn't mean that there is anything wrong with it. Of course there
> is, but those are isolated problems that can be fixed when desired. For
> example, it might just be that those who use it don't have use of INOUT
> parameters or table returns.

Yeah. And I _almost_ fixed those. Just did not have time to make the
final push to clean up things enough to be acceptable for patching back
into core.

And fixing those actually meant refactoring those parts into using newer
structures and functions :)

And I also think that pl/python, even for python 2.x does need lots of
refactoring in most places in order to be maintainable.

--
Hannu Krosing http://www.2ndQuadrant.com
PostgreSQL Scalability and Availability
Services, Consulting and Training


From: James Pye <lists(at)jwp(dot)name>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, Andrew Dunstan <andrew(at)dunslane(dot)net>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Marko Kreen <markokr(at)gmail(dot)com>
Subject: Re: Python 3.0 does not work with PL/Python
Date: 2009-05-29 22:43:05
Message-ID: C7401DA6-C02A-4C3F-A60E-160A871E6F13@jwp.name
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On May 29, 2009, at 1:17 AM, Peter Eisentraut wrote:
> On Friday 29 May 2009 04:06:14 Andrew Dunstan wrote:
>> Otherwise, I'm not too keen simply to throw Python 2.x overboard
>> until
>> it's no longer common on platforms people are likely to want to
>> install
>> Postgres on, if that's what's implied by the original question.
>
> My guess is that we will need to keep around a Python 2.x version
> for at least
> another three years, meaning two or three major PostgreSQL releases.

Yeah, I wasn't meaning to imply tossing 2.x out...