6.0.0-beta1
8/7/25

[#5839] Horde_history does not work where horde DB (Postgres) user does not have CREATE permissions.
Summary Horde_history does not work where horde DB (Postgres) user does not have CREATE permissions.
Queue Horde Base
Queue Version 3.1.5
Type Bug
State Not A Bug
Priority 1. Low
Owners
Requester szymon (at) juraszczyk (dot) com
Created 10/28/2007 (6493 days ago)
Due
Updated 10/28/2007 (6493 days ago)
Assigned
Resolved 10/28/2007 (6493 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
10/28/2007 11:54:13 PM Chuck Hagenbuch Comment #2
State ⇒ Not A Bug
Reply to this comment
At this point in time I don't think that specifying manual creation of 
all sequence tables is a workable solution. For Rdo-based applications 
in the future we'll probably use db-native sequences in many cases, so 
this issue may go away.



What I've done for now is put the missing CREATE grant into the 
create.pgsql script, and added notes about CREATE permissions to 
horde/docs/INSTALL and horde/scripts/sql/README.
10/28/2007 02:27:55 PM szymon (at) juraszczyk (dot) com Comment #1
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ Horde_history does not work where horde DB (Postgres) user does not have CREATE permissions.
Queue ⇒ Horde Base
Reply to this comment
I've recently upgraded old Horde/IMP/Turba installation (from ancient 
before-H3 versions) and I've noticed a mysterious error in horde log 
file which appeared, when users were replying to messages. The errors 
looked like this:



Oct 26 17:44:59 HORDE [error] [imp] Could not log message details to 
Horde_History. Error returned:  DB Error: invalid n

umber [on line 67 of "/home/httpd/horde/html/poczta/imp/lib/Maillog.php"]



After extensive debugging I found that the values that 
Horde_History::log() generates history_id value by calling 
$this->_db->nextId('horde_histories'), which implicitly creates 
sequence horde_histories_seq, provided that the horde DB user has 
CREATE permission. Indeed by default in PostgreSQL everyone can create 
tables in any databases it can connect to. Not everyone likes that 
though and if CREATE permission is revoked from PUBLIC, PEAR is not 
able to create this sequence, which in turn generates this rather 
irrelevant error message.



Please note that create.pgsql.sql does not indicate that horde user 
should have CREATE permission to the database. I don't think it really 
has to have one. And if someone tightens horde database security as I 
did (in my case it actually uses a schema in another database) it may 
be difficult to sort out the problem I experienced (not that I am so 
bright to have done that ;-) ). Maybe I was the first one to 
experience this problem, at least after a quick google search I was 
none the wiser.



My suggestion is that create.pgsql.sql could also create 
horde_histories_seq sequence and any other sequences it possibly 
needs. It could look like this:



CREATE SEQUENCE horde_histories_seq;

GRANT SELECT, UPDATE ON horde_histories_seq TO horde;


Saved Queries