Re: BUG #4182: Enum in Foreign Key broken - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #4182: Enum in Foreign Key broken
Date
Msg-id 9142.1211144502@sss.pgh.pa.us
Whole thread Raw
In response to BUG #4182: Enum in Foreign Key broken  ("Rod Taylor" <rod.taylor@gmail.com>)
List pgsql-bugs
"Rod Taylor" <rod.taylor@gmail.com> writes:
> The Update in the below script results in the following
> ERROR:  no conversion function from some_enum to anyenum

This is coming from

            if (pathtype != COERCION_PATH_FUNC &&
                pathtype != COERCION_PATH_RELABELTYPE)
            {
                /* If target is ANYARRAY, assume it's OK, else punt. */
                if (lefttype != ANYARRAYOID)
                    elog(ERROR, "no conversion function from %s to %s",
                         format_type_be(typeid),
                         format_type_be(lefttype));
            }

I suspect this code needs to make an exception for ANYENUM as well, but
no time to look closely right now.

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Rod Taylor"
Date:
Subject: BUG #4182: Enum in Foreign Key broken
Next
From: Tom Lane
Date:
Subject: Re: BUG #4180: PANIC while PQExec on Client with differen locale from database