Commit 12b0d90a authored by Simon Chabot's avatar Simon Chabot
Browse files

[plpython] Drop plpython support

plpython has never been used in cubicweb. Moreover, it prevents
the upgrade to postgresql 12. In consequence, as of now importing
plpython is the responsability of each cube.

closes #17277267

co-authors:
    - Guillaume Vandevelde
    - Katia Saurfelt
    - Noé Gaumont
    - Simon Chabot
parent ea4db601e405
......@@ -637,7 +637,7 @@ class PostgresTestDataBaseHandler(TestDataBaseHandler):
# XXX factorize with db-create code
self.helper.init_fti_extensions(templcursor)
# install plpythonu/plpgsql language if not installed by the cube
langs = sys.platform == 'win32' and ('plpgsql',) or ('plpythonu', 'plpgsql')
langs = ('plpgsql',)
for extlang in langs:
self.helper.create_language(templcursor, extlang)
cnx.commit()
......
......@@ -395,8 +395,8 @@ class CreateInstanceDBCommand(Command):
cnx.commit()
# postgres specific stuff
if driver == 'postgres':
# install plpythonu/plpgsql languages
langs = ('plpythonu', 'plpgsql')
# install plpgsql language
langs = ('plpgsql',)
for extlang in langs:
if automatic or ASK.confirm('Create language %s ?' % extlang):
try:
......
......@@ -257,6 +257,7 @@ class URLRewriteEvaluator(URLPathEvaluator):
uri = req.url_unquote('/' + '/'.join(parts))
evaluators = sorted(self.vreg['urlrewriting'].all_objects(),
key=lambda x: x.priority, reverse=True)
for rewritercls in evaluators:
rewriter = rewritercls(req)
try:
......
......@@ -61,9 +61,7 @@ Basically, you need to install the following packages:
optionally,
* a `postgresql-plpython-X.Y` package with a version corresponding to that of
the aforementioned packages (e.g. `postgresql-plpython-9.1`).
If you run postgres version prior to 8.3, you'll also need the
`postgresql-contrib-8.X` package for full-text search extension.
(Not needed now by default)
If you run postgres on another host than the |cubicweb| repository, you should
install the `postgresql-client` package on the |cubicweb| host, and others on the
......@@ -149,21 +147,8 @@ at this step, so you can use there a superuser without using this user when runn
the instance. Things that require special privileges at this step:
* database creation, require the 'create database' permission
* install the `plpython` extension language (require superuser)
To avoid using a super user each time you create an install, a nice trick is to
install plpython (and tsearch when needed) on the special `template1` database,
so they will be installed automatically when cubicweb databases are created
without needs for special access rights. To do so, run ::
# Installation of plpythonu language by default ::
$ createlang -U pgadmin plpythonu template1
$ psql -U pgadmin template1
template1=# update pg_language set lanpltrusted=TRUE where lanname='plpythonu';
Where `pgadmin` is a postgres superuser. The last command is necessary since by
default plpython is an 'untrusted' language and as such can't be used by non
superuser. This update fix that problem by making it trusted.
Where `pgadmin` is a postgres superuser.
.. _SQLServerConfiguration:
......
......@@ -44,7 +44,6 @@ to have installed in order for CubicWeb to work:
If you're using a Postgresql database (recommended):
* psycopg2 - http://initd.org/projects/psycopg2 - http://pypi.python.org/pypi/psycopg2
* plpythonu extension
Other optional packages:
......
......@@ -8,3 +8,4 @@ Changes
a deprecation warning is in place, but please update your source code accordingly.
- The database pooler is now dynamic. New connections are opened when needed and closed after a configurable period of time. This can be configured through `connections-pooler-max-size` (default 0, unlimited), `connections-pooler-min-size` (default 0), and `connections-pooler-idle-timeout` (default 600 seconds). The old configuration `connections-pooler-size` has been dropped.
- The support for plpython has been dropped.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment