Fix rewrite_timestamp_walker so that it can process 2 cell list.
This used to work but was broken in 3.1.0 alpha2 using 9.0 parser.
Change history of functions to create lists in gram.y:
SystemFuncName() SystemTypeName()
8.1.3 original list_make2() list_make2()
8.1 import list_make1() list_make1()
8.3 import list_make1() list_make1()
8.4 import list_make1() list_make2()
9.0 import list_make2() list_make2()
/* `now()' FuncCall */
FuncCall *fcall = (FuncCall *) node;
- if (list_length(fcall->funcname) == 1 &&
- strcmp("now", strVal(linitial(fcall->funcname))) == 0)
+ if (list_length(fcall->funcname) == 2 &&
+ strcmp("pg_catalog", strVal(linitial(fcall->funcname))) == 0 &&
+ strcmp("now", strVal(lsecond(fcall->funcname))) == 0)
{
TypeCast *tc = makeNode(TypeCast);
tc->arg = makeTsExpr(ctx);