• Tom Lane's avatar
    Use the properly transformed RangeVar for expandTableLikeClause(). · 19f5a37b
    Tom Lane authored
    transformCreateStmt() adjusts the transformed statement's RangeVar
    to specify the target schema explicitly, for the express reason
    of making sure that auxiliary statements derived by parse
    transformation operate on the right table.  But the refactoring
    I did in commit 50289819 got this wrong and passed the untransformed
    RangeVar to expandTableLikeClause().  This could lead to assertion
    failures or weird misbehavior if the wrong table was accessed.
    
    Per report from Alexander Lakhin.  Like the previous patch, back-patch
    to all supported branches.
    
    Discussion: https://postgr.es/m/05051f9d-b32b-cb35-6735-0e9f2ab86b5f@gmail.com
    19f5a37b
create_table_like.sql 8.37 KB