Issue #22222:fix recursive query for older pgsql versions
Merge pull request #240 from garyhgohoos/22222

Issue #22222:fix recursive query for older pgsql versions