6.0.0-alpha14
7/3/25

[#8700] type cast needed for event_recurtype for postgresql-8.3.8
Summary type cast needed for event_recurtype for postgresql-8.3.8
Queue Kronolith
Queue Version 2.3.2
Type Bug
State Resolved
Priority 1. Low
Owners jan (at) horde (dot) org
Requester michael.menge (at) zdv (dot) uni-tuebingen (dot) de
Created 11/11/2009 (5713 days ago)
Due
Updated 11/12/2009 (5712 days ago)
Assigned 11/12/2009 (5712 days ago)
Resolved 11/12/2009 (5712 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
11/12/2009 01:15:42 PM Jan Schneider State ⇒ Resolved
 
11/12/2009 01:10:30 PM michael (dot) menge (at) zdv (dot) uni-tuebingen (dot) de Comment #6 Reply to this comment
works fine
11/12/2009 12:56:42 PM Jan Schneider Comment #5 Reply to this comment
Try this script.
11/12/2009 12:56:10 PM CVS Commit Comment #4 Reply to this comment
Changes have been made in CVS for this ticket:

Add conversion script for PostgreSQL (Bug #8700).
http://cvs.horde.org/co.php/kronolith/scripts/upgrades/Attic/2006-08-20_fix_recur_int_fields.pgsql.sql?rt=horde&r=1.1.2.1
11/12/2009 12:41:32 PM michael (dot) menge (at) zdv (dot) uni-tuebingen (dot) de Comment #3 Reply to this comment
Here is the Table defenition,

                   Tabelle »public.kronolith_events«
        Spalte        |             Typ             |     Attribute
---------------------+-----------------------------+--------------------
  event_id            | character varying(32)       | not null
  event_uid           | character varying(255)      | not null
  calendar_id         | character varying(255)      | not null
  event_creator_id    | character varying(255)      | not null
  event_description   | text                        |
  event_location      | text                        |
  event_status        | integer                     | default 0
  event_attendees     | text                        |
  event_keywords      | text                        |
  event_exceptions    | text                        |
  event_title         | character varying(255)      |
  event_category      | character varying(80)       |
  event_recurtype     | character varying(11)       | default 0
  event_recurinterval | character varying(11)       |
  event_recurdays     | character varying(11)       |
  event_recurenddate  | timestamp without time zone |
  event_start         | timestamp without time zone |
  event_end           | timestamp without time zone |
  event_alarm         | integer                     | default 0
  event_modified      | integer                     | not null
  event_private       | integer                     | not null default 0
  event_recurcount    | integer                     |
Indexe:
     »kronolith_events_pkey« PRIMARY KEY, btree (event_id)
     »kronolith_calendar_idx« btree (calendar_id)
     »kronolith_uid_idx« btree (event_uid)


an Alter Table to change the type of event_recurtype to integer failed

alter table kronolith_events alter column event_recurtype type integer ;
ERROR:  column "event_recurtype" cannot be cast to type "pg_catalog.int4"

Tracking this down showed that the type was changed
http://cvs.horde.org/h/chora/diff.php/kronolith/scripts/sql/kronolith.pgsql.sql?r1=1.5&r2=1.6

There is a upgrade script to fix this for mysql but not for postgres
11/12/2009 11:54:34 AM Jan Schneider Comment #2
State ⇒ Feedback
Reply to this comment
This doesn't make sense, this is an integer column.
11/11/2009 02:45:21 PM Chuck Hagenbuch State ⇒ Assigned
Assigned to Jan Schneider
 
11/11/2009 02:00:40 PM michael (dot) menge (at) zdv (dot) uni-tuebingen (dot) de Comment #1
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ type cast needed for event_recurtype for postgresql-8.3.8
Queue ⇒ Kronolith
Milestone ⇒
Patch ⇒ No
New Attachment: event_recurtype.patch Download
State ⇒ Unconfirmed
Reply to this comment
Nov 11 13:58:41 HORDE [error] [kronolith] DB Error: unknown error: 
SELECT event_id, event_uid, event_description, event_location, 
event_private, event_status, event_attendees, event_keywords, 
event_title, event_category, event_recurcount, event_recurtype, 
event_recurenddate, event_recurinterval, event_recurdays, event_start, 
event_end, event_alarm, event_modified, event_exceptions, 
event_creator_id FROM kronolith_events WHERE calendar_id = 'xxxxx' AND 
((event_end > '2009-11-01 00:00:00' AND event_start < '2009-12-08 
00:00:00') OR (event_recurenddate >= '2009-11-01 00:00:00' AND 
event_start <= '2009-12-08 00:00:00' AND event_recurtype <> 0)) 
[nativecode=ERROR:  operator does not exist: character varying <> 
integer bei Zeichen 578
TIP:  No operator matches the given name and argument type(s). You 
might need to add explicit type casts.] [pid 4590 on line 331 of 
"horde-3.3.5/kronolith-h3-2.3.2/lib/Driver/sql.php"]

Saved Queries