> In our case this is problematic as in our application we export view > definitions to text files to later import them, we support different > PostgreSQL versions and we would need to keep stable SQL among different > version (export <-> import).
I'm afraid your application has been built on sand. We change insignificant details of view/rule decompiling all the time, and are not likely to stop. I might have more sympathy for your request if it didn't imply putting ruleutils.c into an impossible straitjacket for all time to come.
Strangely we've been lucky for the last pile of years, we always found a way to get a sql that looked the same in all the versions.
Nevertheless I understand it is very fragile. Is there any way to get the original sql text used to create the view?