[Zope-DB] Database Adapter issue

Tom Dossis td@yoma.com.au
Tue, 20 Aug 2002 15:03:35 +1000


Ken wrote:
> Hi all,
> 
> I am new to zope so please bear with me.
> I am trying to get an adapter (any is fine with me :) to work for me.
> I have Postgresql and Mysql running on a FreeBSD 4.5 box, with the latest
> Zope(2.5.1 ?).
> I have gotten all the files and done installs for ZmysqlDA and also the
> MysqlDB, I have also installed the psycopg files.
> In my Product directory there is the Zmysqlda and also the ZPsycopgda
> directories.
> I restart Zope and go to the prodcut management section. It shows them
> listed, but says they are broken.
> When I click on the broken product here is what I get:
> 
> 
> Traceback (most recent call last):
>   File "/usr/local/www/Zope/lib/python/OFS/Application.py", line 531, in
> import_product
>     product=__import__(pname, global_dict, global_dict, silly)
>   File "/usr/local/www/Zope/lib/python/Products/ZPsycopgDA/__init__.py",
> line 92, in ?
>     import DA
>   File "/usr/local/www/Zope/lib/python/Products/ZPsycopgDA/DA.py", line 91,
> in ?
>     from db import DB
>   File "/usr/local/www/Zope/lib/python/Products/ZPsycopgDA/db.py", line 99,
> in ?
>     import psycopg
> ImportError: No module named psycopg


Have you installed the underlying python2.1-psycopg package/module?
If so where? Looks like it's not in your Zope python path..

 From with the python interpreter the following command needs to work 
without error:

import psycopg

> 
> I am sure this is a minor thing, but being new to zope and to database
> adapters, I am a little lost.
> Has anybody seen this or can tell me the best way to remedy this?
> 
> Honestly, this comes from the simple fact that I have installed zope and
> really like it, so am playing around with a new website. I can not get the
> default database to let me insert large enough text blocks. It seems to only
> like allow a 2 k document (using the varchar to create a table) Is there
> another way? varchar(XXXX) doesn't seem to have any effect either way. So I
> thoughtI would just plug in MySQL or Postgres and be done with it.

I use Postgres 7.1 to store faxes encoded in base64 which are >>2K 
(though I use the ZPoPyDA adaptor).
The type 'TEXT' - provides for unlimited number of characters.  A good 
online book can be found at:

http://www.ca.postgresql.org/docs/aw_pgsql_book/index.html


Regards
-Tom

> 
> See how something so simple can get so convoluted?
> wow.. such is life :)
> 
> Thanks for any help you can give !
> 
> Ken
> 
> 
> _______________________________________________
> Zope-DB mailing list
> Zope-DB@zope.org
> http://lists.zope.org/mailman/listinfo/zope-db
>