• H
    Support explicit cast for ARRAY[] constructor · 3ab62529
    Haozhou Wang 提交于
    Backport below commits from upstream:
    
        commit adac22bf
        Author: Tom Lane <tgl@sss.pgh.pa.us>
        Date:   Fri Dec 19 05:04:35 2008 +0000
    
            When we added the ability to have zero-element ARRAY[] constructs by adding an
            explicit cast to show the intended array type, we forgot to teach ruleutils.c
            to print out such constructs properly.  Found by noting bogus output from
            recent changes in polymorphism regression test.
    
        commit 30137bde6db48a8b8c1ffc736eb239bd7381f04d
        Author: Heikki Linnakangas <heikki.linnakangas@iki.fi>
        Date:   Fri Nov 13 19:48:26 2009 +0000
    
            A better fix for the "ARRAY[...]::domain" problem. The previous patch worked,
            but the transformed ArrayExpr claimed to have a return type of "domain",
            even though the domain constraint was only checked by the enclosing
            CoerceToDomain node. With this fix, the ArrayExpr is correctly labeled with
            the base type of the domain. Per gripe by Tom Lane.
    
        commit 6b0706ac
        Author: Tom Lane <tgl@sss.pgh.pa.us>
        Date:   Thu Mar 20 21:42:48 2008 +0000
    
            Arrange for an explicit cast applied to an ARRAY[] constructor to be applied
            directly to all the member expressions, instead of the previous implementation
            where the ARRAY[] constructor would infer a common element type and then we'd
            coerce the finished array after the fact.  This has a number of benefits,
            one being that we can allow an empty ARRAY[] construct so long as its
            element type is specified by such a cast.
    
    Besides, this commit also adds 'location' field in array related
    structures, but they are not actived yet. Thanks to Heikki's suggestion.
    3ab62529
copyfuncs.c 102.9 KB