We already do recursion in pl/pgsql functions now to emulate connect-by statements, and it's quite slow. I would have to assume that moving the recursion to the tcl layer would be even slower, so I don't think there would be of any benefit in doing the connect-by emulation this way.