It seems like an old, raw viewdef has already been obtained from pg_rewrite
before it was blocked by first connection.
Then in `get_query_def`, it tries to parse the raw viewdef.
Before finishing its work, `get_query_def` will acquire locks and wait
until first connection finishes.
After that, during the parsing process, relation names are finally
generated by `generate_relation_name` in ruleutils.c using
`SearchSysCache1`.
And `SearchSysCache1` will use the catalog snapshot to get the latest
relname.
Perhaps we should refer to the code of `pg_get_constraintdef_worker`,
directly using `systable_beginscan` with transaction snapshot?
Regards
Lin Yuzhe