[kronolith] kronolith_events_seq and PostgreSQL [SOLVED]

Heinz Sporn heinz.sporn at sporn-it.com
Wed Jul 20 02:33:39 PDT 2005


Hi all!

I found a solution for my problem - although I am not quite sure about
the implications.

I actually changed the kronolith.pgsql.sql script again. I both had to
introduce a sequence for event_id and had to remove the not null
constraints for event_uid and event_creator_id. 

Kronolith seems to work ok now. But are these changes valid?

Here's the new script:

-- $Horde: kronolith/scripts/sql/kronolith.pgsql.sql,v 1.2 2004/12/13 23:42:40 chuck Exp $

DROP TABLE kronolith_events;
DROP SEQUENCE kronolith_events_seq;
DROP TABLE kronolith_storage;

CREATE SEQUENCE kronolith_events_seq;

CREATE TABLE kronolith_events (
    event_id VARCHAR(32) DEFAULT nextval('kronolith_events_seq'),
    event_uid VARCHAR(255),
    calendar_id VARCHAR(255) NOT NULL,
    event_creator_id VARCHAR(255),
    event_description TEXT,
    event_location TEXT,
    event_status INT DEFAULT 0,
    event_attendees TEXT,
    event_keywords TEXT,
    event_exceptions TEXT,
    event_title VARCHAR(255),
    event_category VARCHAR(80),
    event_recurtype VARCHAR(11) DEFAULT 0,
    event_recurinterval VARCHAR(11),
    event_recurdays VARCHAR(11),
    event_recurenddate TIMESTAMP,
    event_start TIMESTAMP,
    event_end TIMESTAMP,
    event_alarm INT DEFAULT 0,
    event_modified INT NOT NULL,
    PRIMARY KEY (event_id)
);

CREATE INDEX kronolith_calendar_idx ON kronolith_events (calendar_id);
CREATE INDEX kronolith_uid_idx ON kronolith_events (event_uid);

GRANT ALL ON kronolith_events TO hordeaccess;

CREATE TABLE kronolith_storage (
    vfb_owner      VARCHAR(255) DEFAULT NULL,
    vfb_email      VARCHAR(255) NOT NULL DEFAULT '',
    vfb_serialized TEXT NOT NULL
);

CREATE INDEX kronolith_vfb_owner_idx ON kronolith_storage (vfb_owner);
CREATE INDEX kronolith_vfb_email_idx ON kronolith_storage (vfb_email);

GRANT ALL ON kronolith_storage TO hordeaccess;


Am Mittwoch, den 20.07.2005, 11:05 +0200 schrieb Heinz Sporn:
> Hi all!
> 
> I am fighting with kronolith in a Gentoo Linux / PostgreSQL environment.
> All other modules like imp, turba and mnemo are running fine. I have
> emerged horde-kronolith v1.1.4 and downloaded kronolith.pgsql.sql from
> CVS in order to create the tables kronolith_events and
> kronolith_storage. The horde user has been granted with full access to
> the entire horde database.
> 
> Now when I try to save a new calendar entry I get a PostgreSQL error:
> 
> ERROR: Relation >>kronolith_events_seq<< does not exist.
> 
> I learned from some other post that the kronolith_events_seq will be
> created on the fly. In case that won't work someone should try to create
> it manually. I did that with
> 
> CREATE TABLE kronolith_events_seq (id SERIAL NOT NULL, PRIMARY KEY (id)
> 
> Result: PostgreSQL reported
> 
> ERROR: >>kronolith_events_seq<< is not a sequence.
> 
> So tried something else. Jan Schneider mentioned in another post:
> 
> "The event_id is an emulated (or real) sequence. How it is implemented
> exactly depends on your database. You should get detailed instructions
> how
> to increase the sequence number on the general PEAR mailing list."
> 
> Now I tweaked the kronolith.pgsql.sql script changing "event_id
> VARCHAR(32) NOT NULL" to "event_id SERIAL NOT NULL". Wasn't that simple,
> got the same error.
> 
> Since I am neither the big PostgreSQL guru nor a PEAR nerd I am pretty
> much stuck here. Anyone out there how could help me with this?
> 
> -- 
> Mit freundlichen Grüßen
> 
> Heinz Sporn
> 
> SPORN it-freelancing
> 
> Mobile: ++43 (0)699 / 127 827 07
> Email:  heinz.sporn at sporn-it.com
>         heinz.sporn at utanet.at
> Snail:  Steyrer Str. 20
>         A-4540 Bad Hall
>         Austria / Europe
> 
-- 
Mit freundlichen Grüßen

Heinz Sporn

SPORN it-freelancing

Mobile: ++43 (0)699 / 127 827 07
Email:  heinz.sporn at sporn-it.com
        heinz.sporn at utanet.at
Snail:  Steyrer Str. 20
        A-4540 Bad Hall
        Austria / Europe



More information about the kronolith mailing list