Summary | null value in column rule_id with postgresql |
Queue | Ingo |
Queue Version | Git master |
Type | Bug |
State | Resolved |
Priority | 2. Medium |
Owners | jan (at) horde (dot) org |
Requester | michael.menge (at) zdv (dot) uni-tuebingen (dot) de |
Created | 03/09/2011 (5244 days ago) |
Due | |
Updated | 03/09/2011 (5244 days ago) |
Assigned | 03/09/2011 (5244 days ago) |
Resolved | 03/09/2011 (5244 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | 4 |
Patch | No |
Assigned to Jan Schneider
Taken from
Taken from Chuck Hagenbuch
State ⇒ Feedback
Fix creating new rules with PostgreSQL (
Bug #9638).3 files changed, 4 insertions(+), 4 deletions(-)
http://git.horde.org/horde-git/-/commit/d8332264c0dcf55ffd522b99d5874ea2962754e2
autoincrementing on the rule_id column:
ALTER TABLE "ingo_rules" ALTER COLUMN "rule_id" SET DEFAULT
NEXTVAL('ingo_rules_rule_id_seq')
No idea why it doesn't work.
INSERT INTO ingo_rules (rule_id, rule_owner, rule_name, rule_action,
rule_value, rule_fl
ags, rule_conditions, rule_combine, rule_stop, rule_active,
rule_order) VALUES (NULL, 'zrsmm01', 'Whitelist', 9, NULL, NULL, NULL,
NULL,
NULL, 1, 1)
which fails as rule_id has not-null constraint. Omitting the columns
with NULL vlaues or relpacing them with DEFAULT works
INSERT INTO ingo_rules (rule_owner, rule_name, rule_action,
rule_active, rule_order) VALUES ('zrsmm01','Whitelist',9,1,1);
INSERT INTO ingo_rules (rule_id, rule_owner, rule_name, rule_action,
rule_value, rule_flags, rule_conditions, rule_combine, rule_stop,
rule_active, rule_order) VALUES
(DEFAULT,'zrsmm01','Whitelist',9,DEFAULT,DEFAULT,DEFAULT,DEFAULT,DEFAULT,1,1);
Assigned to Chuck Hagenbuch
Assigned to
State ⇒ Assigned
Milestone ⇒ 4
autoincrementing on the rule_id column:
ALTER TABLE "ingo_rules" ALTER COLUMN "rule_id" SET DEFAULT
NEXTVAL('ingo_rules_rule_id_seq')
No idea why it doesn't work.
New Attachment: ingo_exception.txt
New Attachment: db_migrate_ingo.log
database on an irregular basis, so I don't know when
at which time we did update the ingo schema.
db_migrate ingo 1
db_migrate ingo
Attached is the output of
db_migrate ingo 1 and db_migrate ingo
migration step didn't work correctly and has been fixed since. Try:
db_migrate ingo 1
db_migrate ingo
./db_migrate ingo
[ INFO ] Migrating DB up.
[ INFO ] Current ingo schema version: 5
[ INFO ] Ending ingo schema version: 5
State ⇒ Feedback
Priority ⇒ 2. Medium
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Summary ⇒ null value in column rule_id with postgresql
Type ⇒ Bug
Queue ⇒ Ingo
clicking on Ingo results in the following error
2011-03-09T10:09:54+01:00 DE
BUG: 1. require() horde/ingo/index.php:132. Ingo_Storage->retrieve() horde/ingo/filters.php:17
3. Ingo_Storage_Sql->_retrieve() horde/ingo/lib/Storage.php:138
4. Ingo_Storage_Filters_Sql->init() horde/ingo/lib/Storage/Sql.php:87
5. Ingo_Storage_Filters_Sql->addRule()
horde/ingo/lib/Storage/Filters/Sql.php:74
6. Horde::errorHandler() horde/ingo/lib/Storage/Filters/Sql.php:140
2011-03-09T10:09:54+01:00 DEBUG: HORDE [ingo] SQL (0,0012s)
2011-03-09T10:09:54+01:00 DEBUG: HORDE [ingo] SQL PK and serial
sequence (0,0892s)
AND dep.refobjid = 'ingo_rules'::regclass [pid 23310 on
line 773 of
"/home/zrssk01/horde/framework/Db/lib/Horde/Db/Adapter/Base.php"]
2011-03-09T10:09:54+01:00 DEBUG: HORDE [ingo] SQL PK and custom
sequence (0,0602s)
'ingo_rules'::regclass AND cons.contype = 'p' AND def.adsrc ~*
2011-03-09T10:09:55+01:00 ERR: HORDE [ingo] SQL QUERY FAILED:
SQLSTATE[23502]: Not null violation: 7 ERROR: null value in column
"rule_id" violates not-null constraint
INSERT INTO ingo_rules (rule_id, rule_owner, rule_name, rule_action,
2011-03-09T10:09:55+01:00 DEBUG: HORDE [ingo] SQL
INSERT INTO ingo_rules (rule_id, rule_owner, rule_name, rule_action,
2011-03-09T10:09:55+01:00 EMERG: HORDE [ingo] SQLSTATE[23502]: Not
null violation: 7 ERROR: null value in column "rule_id" violates
not-null constraint [pid 23310 on line 146 of
"/home/zrssk01/horde/ingo/lib/Storage/Filters/Sql.php"]