[Zope-DB] Seeking help with Accessing Zope from PostgreSQL

Ken Winter ken at sunward.org
Mon Nov 12 11:37:48 EST 2007

I'm trying to implement the scheme for "Accessing Zope from PostgreSQL" that
is described in http://zope.org/Members/pupq/zope_in_pg.  I'm trying to
implement it in a Plone installation in a WinXP environment (Plone 2.5.2,
Zope 2.9.6, Python 2.4.3, win32, PostgreSQL 8.1.10).  

I have changed the file paths in the above reference's zstart() function so
that they refer to the appropriate (I hope) directories and files in my
environment.  My zstart() now reads like this:

	CREATE or REPLACE FUNCTION public.zstart()
	RETURNS pg_catalog.text AS '
	if GD.has_key("zope_app"):
	import sys
	sys.path.insert(0, "\Program Files\Plone 2\Zope\lib\python")
	sys.path.insert(0, "\Program Files\Plone
	import Zope
	Zope.configure("\Program Files\Plone 2\Zope\skel\etc\zope.conf.in")
	from ZODB.Transaction import get_transaction
	' LANGUAGE 'plpythonu' VOLATILE;

But when I try to run zstart() with this SQL:

	select zstart();

I get this error:

	PostgreSQL Error Code: (1)
	ERROR:  plpython: function "zstart" failed
	DETAIL:  exceptions.SystemExit: 2
	0 Record(s) Returned

Any suggestions to make this work?

~ TIA	
~ Ken

More information about the Zope-DB mailing list