Forum OpenACS Q&A: Package ACS Events Installation Error

I have SuSe 10.1, PostgreSQL 8.1, OpenACS 5.2.2 and when trying to install acs-events, the following error happens:

Failed to install ACS Events, version 0.5. The following error was generated:

CONTEXT: SQL statement "SELECT acs_attribute_id_seq.nextval"
PL/pgSQL function "acs_attribute__create_attribute" line 28 at select into variables
PL/pgSQL function "inline_0" line 20 at assignment
psql:acs-events-create.sql:708: ERROR: syntax error at or near "v_html_p" at character 142
QUERY: SELECT coalesce(e.html_p, a.html_p) from acs_events e left join acs_activities a on (e.activity_id = a.activity_id) where e.event_id = $1 v_html_p $2
CONTEXT: SQL statement in PL/PgSQL function "acs_event__get_html_p" near line 12
psql:acs-events-create.sql:708: LINE 1: ...ivity_id = a.activity_id) where e.event_id = $1 v_html_p ...
psql:acs-events-create.sql:708: ^
psql:acs-events-create.sql:736: ERROR: syntax error at or near "v_status_summary" at character 158
QUERY: SELECT coalesce(e.status_summary, a.status_summary) from acs_events e left join acs_activities a on (e.activity_id = a.activity_id) where e.event_id = $1 v_status_summary $2
CONTEXT: SQL statement in PL/PgSQL function "acs_event__get_status_summary" near line 11
psql:acs-events-create.sql:736: LINE 1: ...ivity_id = a.activity_id) where e.event_id = $1 v_status_s...
psql:acs-events-create.sql:736:

Can someone help me? Thanks, Ricardo Jorge

Collapse
Posted by Stan Kaufman on
I don't know about this specific problem, but according to People Who Know, PG 8.1 doesn't work with OpenACS. See:

https://openacs.org/forums/message-view?message_id=350707
https://openacs.org/forums/message-view?message_id=397013
https://openacs.org/forums/message-view?message_id=201266

You should back up to PG 8.0.x and try again.

Collapse
Posted by Ricardo Jorge on
If nobody fix todays problems ( issues ), we will never move to the next step.

Besides package ACS Events, I can tell that working with PostgreSQL 8.1 is not that difficult, nor impossible.

I already help fix issues with News Aggregator and Forums is also working.

I am testing tsearch2 and it seems to be working fine, but I also want to install Lars Blogger that needs ACS Events.

The problem with package ACS Events, seems to be related to these 2 functions:

======== First ===============
declare
get_html_p__event_id alias for $1; -- in acs_events.event_id%TYPE
v_html_p acs_events.html_p%TYPE;
begin
select coalesce(e.html_p, a.html_p) into v_html_p
from acs_events e
left join acs_activities a
on (e.activity_id = a.activity_id)
where e.event_id = get_html_p__event_id

return v_html_p;

end;' language 'plpgsql';

========== Second ===========
declare
get_status_summary__event_id alias for $1; -- acs_events.event_id%TYPE
v_status_summary acs_events.status_summary%TYPE;
begin
select coalesce(e.status_summary, a.status_summary) into v_status_summary
from acs_events e
left join acs_activities a
on (e.activity_id = a.activity_id)
where e.event_id = get_status_summary__event_id

return v_status_summary;

end;' language 'plpgsql';

Let's see what else can be done. Thanks Ricardo Jorge

Collapse
Posted by Ricardo Jorge on
OK, here is the fix for ACS Events to work with PostgreSQL ( PG ) 8.1

The fix was made available with the great help from Michael Steigman.

======= First ==============

declare
get_html_p__event_id alias for $1; -- in acs_events.event_id%TYPE
v_html_p acs_events.html_p%TYPE;
begin
select coalesce(e.html_p, a.html_p) into v_html_p
from acs_events e
left join acs_activities a
on (e.activity_id = a.activity_id)
where e.event_id = get_html_p__event_id

return v_html_p;

end;' language 'plpgsql';

becomes =========>

declare
get_html_p__event_id alias for $1; -- in acs_events.event_id%TYPE
v_html_p acs_events.html_p%TYPE;
begin
select coalesce(e.html_p, a.html_p) into v_html_p
from acs_events e
left join acs_activities a
on (e.activity_id = a.activity_id)
where e.event_id = get_html_p__event_id; ( missing ";" )

return v_html_p;

end;' language 'plpgsql';
============================

======== Second ============

declare
get_status_summary__event_id alias for $1; -- acs_events.event_id%TYPE
v_status_summary acs_events.status_summary%TYPE;
begin
select coalesce(e.status_summary, a.status_summary) into v_status_summary
from acs_events e
left join acs_activities a
on (e.activity_id = a.activity_id)
where e.event_id = get_status_summary__event_id

return v_status_summary;

end;' language 'plpgsql';

becomes =========>

declare
get_status_summary__event_id alias for $1; -- acs_events.event_id%TYPE
v_status_summary acs_events.status_summary%TYPE;
begin
select coalesce(e.status_summary, a.status_summary) into v_status_summary
from acs_events e
left join acs_activities a
on (e.activity_id = a.activity_id)
where e.event_id = get_status_summary__event_id; ( missing ";" )

return v_status_summary;

end;' language 'plpgsql';
============================

So, this *all* you need to make ACS Events work with PG 8.1

Thanks Ricardo Jorge

Collapse
Posted by Stan Kaufman on
Weird. Those typos (missing semicolons) don't cause installation problems with PG 8.0.x. Regardless, I've commited the fix to oacs-5-2.

However, I gather from what people like Don have said, that you're going to run into trouble with PG 8.1 at other points with other packages because of the toolkit's use of tree_sortkeys and changes in how PG implements things in 8.1 compared to 8.0. Perhaps some other issues too. But it's not merely a problem with two missing semicolons in one create sql script.

See https://openacs.org/forums/message-view?message_id=365242.

Collapse
Posted by Michael Steigman on
Stan,

The semi-colons are also missing from the upgrade scripts. Can you fix that too? Thanks.

Collapse
Posted by Ricardo Jorge on
Ok, I am not telling everything is that easy ( missing characters, or declaration order inside sql files ), but if you have 50 modules to test and migrate from version X to version Y and someone else already tested 20 or 30 modules with version Y, then you need to put your efforts in less modules / packages.

Also, I am not telling people to move their production system to PG 8.1, but some modules can run. Currently I have:

- News Aggregator
- Lars Blogger
- Forums
- Search
- Files
- General Comments
- Notifications

There are messages from others, that are trying to install OpenACS + PG 8.1 like this: http://www.openacs.org/forums/message-view?message_id=45184

This is not a matter of being "hi tech", but new Linux distributions are using newer packages.

Besides that, there are advantages using some of these newer packages.

I am just trying to contribute. If I can be of any help in other tests, please let me know. Thanks Ricardo Jorge

Collapse
Posted by Ricardo Jorge on
Ooops !

Previous message has a wrong link. Correct is:

http://www.openacs.org/forums/message-view?message_id=451846

Sorry. Ricardo JOrge

Collapse
Posted by Stan Kaufman on
Michael -- thanks for pointing out the upgrade script issue; I've commited the fix there to oacs-5-2 also.

Ricardo -- great job working through compatibility checks! I'm certain that the OCT has every intention of making OpenACS work with PG 8.1. It's just not apparently a trivial matter -- at least in some packages.