Menu

ERROR: failed to find conversion function

Terry
2009-12-10
2013-06-04
  • Terry

    Terry - 2009-12-10

    Using postgres 8.4.1, I am getting this error:

    **ERROR: failed to find conversion function from unknown to character varying**

    This is fixed by changing: `''` to `cast('' as varchar)` in permissions.pdl.
    This possibly also affects other queries but at least I can log in now.

    Is anybody else running postgres 8.4.1 and having this problem?

     
  • Terry

    Terry - 2009-12-10

    Here is the patch for permissions.pdl:

        Index: permissions.pdl
        ===================================================================
        -- permissions.pdl (revision 2027)
        +++ permissions.pdl (working copy)
        @@ -161,8 +161,8 @@
                              0 as user_p,
                              groups.name as name,
                              parties.primary_email as primary_email,
        -                     '' as given_name,
        -                     '' as family_name,
        +                     cast('' as varchar) as given_name,
        +                     cast('' as varchar) as family_name,
                              0 as name_id
                       from groups, parties
                       where groups.group_id = parties.party_id) parties
        @@ -181,7 +181,7 @@
                 from acs_permissions,
                      (select users.user_id as party_id,
                              1 as user_p,
        -                     '' as name,
        +                     cast('' as varchar) as name,
                              parties.primary_email as primary_email,
                              person_names.given_name as given_name,
                              person_names.family_name as family_name,
        @@ -506,8 +506,8 @@
                              0 as user_p,
                              groups.name as name,
                              parties.primary_email as primary_email,
        -                     '' as given_name,
        -                     '' as family_name,
        +                     cast('' as varchar) as given_name,
        +                     cast('' as varchar) as family_name,
                              0 as name_id
                       from groups, parties
                       where groups.group_id = parties.party_id) parties
        @@ -541,7 +541,7 @@
                        and p.object_id = dgc.pd_context_id) acs_permissions,
                      (select users.user_id as party_id,
                              1 as user_p,
        -                     '' as name,
        +                     cast('' as varchar) as name,
                              parties.primary_email as primary_email,
                              person_names.given_name as given_name,
                              person_names.family_name as family_name,

     
  • Terry

    Terry - 2009-12-12

    I change the casts to `cast('' as char)` and they worked on Oracle 10g too so I have committed this change as .

      : https://fedorahosted.org/aplaws/changeset/2037/

     
  • pboy

    pboy - 2009-12-14

    Hi Terry,

    thanks for the patch. I run into that problem as well and reverted to version 8.3 as an interim solution. I'll test the patch here in the next days.

    Peter

     
  • Terry

    Terry - 2009-12-14

    Great. As I mentioned in the commit, I have tested the modified query with postgres 8.4.1 and Oracle XE 10.2.0.1.0.

    I suspect the problem only exhibits itself when there is a UNION clause but the only other queries with a UNION seem to work fine.

     
  • pboy

    pboy - 2009-12-15

    I'll do testing with Postgresql  8.1, 8.3  and 8.4. If there are no problems (and the patch should not have any side effect I suppose inspecting the code) I would suggest to include it in the upcomming 1.0.5 release.

    Peter

     

Log in to post a comment.