Bugs #2927: PostgreSQL Error when viewsing history

Ticket modified by Klaus Leithoff at 2011/04/11 17:31
Tracking System: Bugs
Category: Wiki
Version: Trunk
Status: Open
Resolution: None
Completed: 10%
Priority: 5 - medium
Created By: Lars Boegild Thomsen
Created on: 2011/04/06 02:57
Assigned to: Ralf Becker
Summary: #2927 - PostgreSQL Error when viewsing history
In trunk as of yesterday:

Invalid SQL: SELECT wiki_rate_time,wiki_rate_viewLimit,wiki_rate_searchLimit,wiki_rate_editLimit FROM egw_wiki_rate WHERE wiki_rate_ip=‘193.89.191.35’:
ERROR: column “wiki_rate_viewlimit” does not exist
LINE 1: SELECT wiki_rate_time,wiki_rate_viewLimit,wiki_rate_searchLi…

Comment by Klaus Leithoff at 2011/04/11 17:31:
ralf is fixing it.
Comment by Klaus Leithoff at 2011/04/11 17:14:
Postgres seems to require those columns quoted.
As this query does run:
SELECT wiki_rate_time,“wiki_rate_viewLimit”,“wiki_rate_searchLimit”,“wiki_rate_editLimit” FROM egw_wiki_rate WHERE wiki_rate_ip=‘127.0.0.1’;
Comment by Klaus Leithoff at 2011/04/07 15:53:
postgres: I noticed.
Strange. I will check what seems to be wrong.

Comment by Lars Boegild Thomsen at 2011/04/07 15:33:
Yes sure:

egroupware=> \d egw_wiki_rate
Table "public.egw_wiki_rate"
Column | Type | Modifiers
-----------------------±----------------------±---------------------------------------
wiki_rate_ip | character varying(20) | not null default ‘’::character varying
wiki_rate_time | integer |
wiki_rate_viewLimit | smallint |
wiki_rate_searchLimit | smallint |
wiki_rate_editLimit | smallint |
Indexes:
“egw_wiki_rate_pkey” PRIMARY KEY, btree (wiki_rate_ip)

I noticed the table is defined as viewLimit but the error say viewlimit - but if I am not mistaken sql names are only case sensitive if quoted.

Notice this is postgresql and not mysql.
Comment by Klaus Leithoff at 2011/04/06 16:35:
Could you check if the table is available as defined in tables_current?

Or for example here:
CREATE TABLE IF NOT EXISTS egw_wiki_rate (
wiki_rate_ip varchar(20) NOT NULL,
wiki_rate_time int(11) DEFAULT NULL,
wiki_rate_viewLimit smallint(6) DEFAULT NULL,
wiki_rate_searchLimit smallint(6) DEFAULT NULL,
wiki_rate_editLimit smallint(6) DEFAULT NULL,
PRIMARY KEY (wiki_rate_ip)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

linked entries:
http://www.egroupware.org/egroupware/index.php?menuaction=tracker.tracker_ui.edit&tr_id=2927&no_popup=1