Setting environment variables for PostgreSQL

Andreas Tille tillea at rki.de
Mon Feb 19 17:21:16 CET 2007


On Mon, 19 Feb 2007, Fabio Tranchitella wrote:

> I know that it is quite inelegant, but you could try to add the:
>
>  export PGCLIENTENCODING=LATIN1
>
> to the file:
>
>  /var/lib/zope2.X/instance/$INSTANCE/bin/zopectl

I tried - but no change. :-(

>> which works perfectly if I use psql as client.  So I tried
>> both
>>
>>    1. Adding
>>          export PGCLIENTENCODING=LATIN1
>>       on top of /etc/init.d/zope2.9 and
>
> This should work, indeed. I'll investigate further...

I thought that it "should" work as well, but ...

>>    2. adding
>>          PGCLIENTENCODING=LATIN1
>>       to /etc/default/zope2.9
>
> This is not supported, as the default file is just used for a few
> variables but the content is not exported.

No problem - I just wanted to try something else ...

>> BTW, I tried to set the encoding directly in the
>>      Z Psycopg Database Connection
>> object, as 'LATIN1' without any success as well
>
> This should work and it should be the right approach. What about psycopg2
> and ZPsycopg2DA? Do they work for this use case?

I did

    $ sudo aptitude install zope-psycopgda2
    $ sudo aptitude purge zope-psycopgda     # no need to have both of them
    $ sudo dzhandle add-product default ZPsycopgDA
      # beeing a little bit unsure whether I should prefer
      #   sudo dzhandle add-product default ZPsycopgDA:2
      # and what the difference might be
    $ sudo /etc/init.d/zope2.9 restart

Nothing changed.  I verified the "Z Psycopg 2 Database Connection"
and reallized that there is not even a property like "Backend encoding"
as it was in psycopg (1.x) - so I see no chance to fix it this way.

Any further idea?

Kind regards

          Andreas.

-- 
http://fam-tille.de



More information about the pkg-zope-developers mailing list