Forum OpenACS Development: Response to How do correct a cache lookup error

Collapse
Posted by Sid Widge on
Hi everyone

Further to my question on the cache lookup. I have identified where the problem is. 

The information exists in the database and I have tried running the select statements manually through the databases. They do work when I run them through manually. 

As far as I can see the problem lies in the following section of code which is found in the *-postgres.xql file:



      
    select s.slide_title,
    s.sort_key,
    wp_slide__get_preamble(:slide_item_id) as preamble,
    wp_slide__get_postamble(:slide_item_id) as postamble,
    wp_slide__get_bullet_items(:slide_item_id) as bullet_items,
    to_char(ao.creation_date, 'HH24:MI, Mon DD, YYYY') as modified_date
    from cr_wp_slides s, cr_items i, acs_objects ao
    where i.item_id = :slide_item_id
    and   i.live_revision = s.slide_id
    and   ao.object_id = s.slide_id
      



What I figure is that the problem is coming where it is trying to call wp_slide__get_preamble(integer). This function is as follows:

create function wp_slide__get_preamble(integer)
returns record as'
declare
get_preamble__slide_item_id                alias for $1;
v_blob record;
begin
    select content into v_blob
    from cr_revisions, cr_items
    where cr_items.content_type = ''cr_wp_slide_preamble''
    and cr_items.parent_id = get_preamble.slide_item_id
    and cr_revisions.revision_id = cr_items.live_revision;
    return v_blob;
end;' language 'plpgsql';


Now the error message I am getting is:
Error: Ns_PgExec: result status: 7 message: ERROR:  fmgr_info: function 0: cache lookup failed


But I know that all the individual queries work. It is just the part where the xql file queries: wp_slide__get_preamble. 

I am not sure why this is happening. Would anyone have any suggestion what I could do to rectify this?

Thanks.
Jack P