Databases: Please use the prefix in Postgres index names

Databases: Please use the prefix in Postgres index names

by Tim Hunt -
Number of replies: 6
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
You cannot install 2 instances of Moodles into one Postgres database with different prefixes becuase some indexes have names than don't include the database prefix, and they give errors the second time you install. I have filed bug 5515 about this. Why can't I assign that bug to myself? I'm about to checkin a fix for this.
Average of ratings: -
In reply to Tim Hunt

Re: Databases: Please use the prefix in Postgres index names

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Actually, no I can't fix this, since we are in a database freeze. Aren't we. Anyway, there is a patch attached to the bug I filed. I'll let MD decide what he wants to do about this.
In reply to Tim Hunt

Re: Databases: Please use the prefix in Postgres index names

by Martín Langhoff -
Hi Tim! We are looking into rolling your changes into the patch series being discussed over here: http://moodle.org/mod/forum/discuss.php?d=45058

I will be proposing a db version bump for core and a couple of modules, covering those changes. Any other issues with Pg you know about?
In reply to Martín Langhoff

Re: Databases: Please use the prefix in Postgres index names

by Jun Yamog -
Patch added to our set of pg patches.  Diff is here
In reply to Martín Langhoff

Re: Databases: Please use the prefix in Postgres index names

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Any other issues with Pg you know about?

Nothing that I spotted doing a clean 1.6 branch install into a PG database that already contained other moodles.

Oh, one other thing I do remember: in the past I have seen errors from adodb when it tries to create its adodb_logsql table, since that does not use the prefix, and every moodle tries to create it on install. Did that get fixed. I don't remember seeing that on the most recent clean install I did.
In reply to Tim Hunt

Re: Databases: Please use the prefix in Postgres index names

by Jun Yamog -
Hi Tim,

It seems adodb_logsql does not use prefix.  This is from my copy:

CREATE TABLE adodb_logsql (
   created timestamp NOT NULL,
   sql0 varchar(250) NOT NULL,
   sql1 text NOT NULL,
   params text NOT NULL,
   tracer text NOT NULL,
   timer decimal(16,6) NOT NULL
);

Is this meant to be in a prefix?  Martin L has committed the patches for postgresql, please kindly test them.
In reply to Jun Yamog

Re: Databases: Please use the prefix in Postgres index names

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
The point is that this table belongs to adodb, not moodle, and the adodb code is 3rd party code that we don't want to change.

So we can't and should not change the name of this table.

What we should do is make sure that if you install two moodles into one database, it should not try to create the already existing table and display an error message when it fails.