X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 0F02030EEDD for ; Mon, 16 Jun 2003 20:39:33 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 87560-05 for ; Mon, 16 Jun 2003 17:39:22 -0300 (ADT) Received: from mail.w-koerting.de (mail.w-koerting.de [213.133.109.52]) by svr1.postgresql.org (Postfix) with ESMTP id F2B0D30DE85 for ; Mon, 16 Jun 2003 17:39:20 -0300 (ADT) Received: from thea.w-koerting.de (localhost [127.0.0.1]) by mail.w-koerting.de (Postfix) with ESMTP id E4B91248008 for ; Mon, 16 Jun 2003 22:39:19 +0200 (CEST) Received: from ghaering.de (pD9EB77F8.dip.t-dialin.net [217.235.119.248]) by thea.w-koerting.de (tmda-ofmipd) with ESMTP; Mon, 16 Jun 2003 22:39:18 +0200 (CEST) Message-ID: <3EEE2B19.5070007@ghaering.de> Date: Mon, 16 Jun 2003 22:39:53 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4b) Gecko/20030507 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-interfaces@postgresql.org Subject: Re: PL/Python import _sre module error References: <000a01c331d8$edd28680$0df4623e@79> <200306161357.20600.JLT@WVInter.Net> <1055795688.1529.19.camel@gwpogo.localdomain> In-Reply-To: <1055795688.1529.19.camel@gwpogo.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit From: =?ISO-8859-1?Q?Gerhard_H=E4ring?= X-Delivery-Agent: TMDA/0.76 (Middleground) X-Archive-Number: 200306/54 X-Sequence-Number: 4265 Glenn R Williams wrote: > Hi All, > > Does anyone else have a problem with importing the re package > I am using: > > Redhat 9.0 > PostgreSQL 7.3.3 > Python 2.2.2.26 > > When I create a function: > > import re > o = args[0] > b = re.match(r"^t.*",o) > if b: > return "fits the bill" > return "failed the test" > > PostgreSQL fails, and returns the error message: > > exceptions.ImportError: No module named _sre > > If I go into python, this is not a problem, so I suppose it is somehow > due to the restricted execution environment and/or PostgreSQL. But > that's as far as I get. Correct. re is not enabled, because you can create arbitrary cpu (and perhaps also memory) utilization with it. Thus it's unsafe. > Any suggestions on how to pinpoint the problem? [...] Fork pl/python and create an unsafe version without any restrictions? That's what I once did just for fun. I think that'll be necessary anyway, because with Python >= 2.2.3, rexec and friends are disabled anyway. -- Gerhard