problems installing plpythonu

Bug #396401 reported by Ferdinand
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KDE OpenObject Client
New
Low
Unassigned

Bug Description

1) the db user must be superuser to issue CREATE LANGUAGE plpythonu;
- which seems not to be the case for the rest of OpenERP processes
my dbuser has only dbcreate rights

2) after "CREATE LANGUAGE plpythonu;" as superuser - an error is issued
......
execute
    res = self._obj.execute(query, params)
ProgrammingError: permission denied for language plpythonu

any hint?

Revision history for this message
Albert Cervera i Areny - http://www.NaN-tic.com (albert-nan) wrote : Re: [Bug 396401] [NEW] problems installing plpythonu

A Dimarts, 7 de juliol de 2009, Ferdinand @ ChriCar va escriure:
> Public bug reported:
>
> 1) the db user must be superuser to issue CREATE LANGUAGE plpythonu;
> - which seems not to be the case for the rest of OpenERP processes
> my dbuser has only dbcreate rights

Yes, but there's no way we can workaround this. As you've seen in this version
we try to create the language automatically, but there's now way of doing that
if the user which is used to access the database is not a superuser. Which is
the right thing to do if you have security in mind.

> 2) after "CREATE LANGUAGE plpythonu;" as superuser - an error is issued
> ......
> execute
> res = self._obj.execute(query, params)
> ProgrammingError: permission denied for language plpythonu
>
> any hint?

Please try:

GRANT ALL ON LANGUAGE plpythonu TO your_openerp_user;

>
> ** Affects: openobject-client-kde
> Importance: Undecided
> Status: New

--
Albert Cervera i Areny
http://www.NaN-tic.com
Mòbil: +34 669 40 40 18

Revision history for this message
Ferdinand (office-chricar) wrote :

Now I tried

CREATE trusted LANGUAGE plpythonu;

GRANT ALL ON trusted LANGUAGE plpythonu TO openerpuser;
                             ^
blau5=# GRANT ALL ON LANGUAGE plpythonu TO openerpuser;
ERROR: language "plpythonu" is not trusted
HINT: Only superusers can use untrusted languages.
blau5=#

so it seems that the db-user must be superuser.
But I do not understand your comment that openerp user being superuser should increase security ?

Revision history for this message
Albert Cervera i Areny - http://www.NaN-tic.com (albert-nan) wrote : Re: [Bug 396401] Re: problems installing plpythonu

A Dimarts, 7 de juliol de 2009, Ferdinand @ ChriCar va escriure:
> Now I tried
>
> CREATE trusted LANGUAGE plpythonu;
>
> GRANT ALL ON trusted LANGUAGE plpythonu TO openerpuser;
> ^
> blau5=# GRANT ALL ON LANGUAGE plpythonu TO openerpuser;
> ERROR: language "plpythonu" is not trusted
> HINT: Only superusers can use untrusted languages.
> blau5=#
>
> so it seems that the db-user must be superuser.
> But I do not understand your comment that openerp user being superuser
> should increase security ?

No. It's the other way round. I mean it should _not_ be superuser. The problem
as you said is that for using PL/PythonU it should be superuser. The only
possibility would be to reimplement the trigger in a trusted language such as
SQL or PL/SQL, if the administrator doesn't want to use a database superuser.

--
Albert Cervera i Areny
http://www.NaN-tic.com
Mòbil: +34 669 40 40 18

Revision history for this message
Albert Cervera i Areny - http://www.NaN-tic.com (albert-nan) wrote :

By now I've documented this in module's description.

Changed in openobject-client-kde:
importance: Undecided → Low
Revision history for this message
Ferdinand (office-chricar) wrote :

Hint
login as superuser using psql (as user postgres)
* psql -d <database>
* alter user <database user> superuser;

the following is also done by the fts install script
login as <database user>
* psql -d <database> -U <database user>
* CREATE LANGUAGE plpythonu;

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.