Re: [BUGS] Failure to coerce unknown type to specific type - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: [BUGS] Failure to coerce unknown type to specific type
Date
Msg-id CAKFQuwa6LsueyCBfDTi0DrdX16c0Eh5NO67nJp5K=NcDAYyBOQ@mail.gmail.com
Whole thread Raw
In response to Re: [BUGS] Failure to coerce unknown type to specific type  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
Responses Re: [BUGS] Failure to coerce unknown type to specific type
List pgsql-hackers
On Thu, Apr 23, 2015 at 1:07 AM, Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp> wrote:
Hello, I think this is a bug.

The core of this problem is that coerce_type() fails for Var of
type UNKNOWNOID.

The comment for the function says that,

> * The caller should already have determined that the coercion is possible;
> * see can_coerce_type.

But can_coerce_type() should say it's possible to convert from
unknown to any type as it doesn't see the target node type. I
think this as an inconsistency between can_coerce_type and
coerce_type. So making this consistent would be right way.


​You have two pieces of contradictory knowledge - how are you picking which one to "fix"?​

Concerning only this issue, putting on-the-fly conversion for
unkown nonconstant as attached patch worked for me. I'm not so
confident on this, though..

​Confident about what aspect - the safety of the patch itself or whether the conversion is even a good idea?​

David J.​

pgsql-hackers by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: [BUGS] Failure to coerce unknown type to specific type
Next
From: Sawada Masahiko
Date:
Subject: Re: Auditing extension for PostgreSQL (Take 2)