Corey Huinker <corey.huin...@gmail.com> writes: > Export functions was my original plan, for simplicity, maintenance, etc, > but it seemed like I'd be adding quite a few functions, so the one view > made more sense for an initial version. Also, I knew that pg_dump or some > other stats exporter would have to inline the guts of those functions into > queries for older versions, and adapting a view definition seemed more > straightforward for the reader than function definitions.
Hmm, I'm not sure we are talking about the same thing at all. What I am proposing is *import* functions. I didn't say anything about how pg_dump obtains the data it prints; however, I would advocate that we keep that part as simple as possible. You cannot expect export functionality to know the requirements of future server versions, so I don't think it's useful to put much intelligence there. So I think pg_dump should produce a pretty literal representation of what it finds in the source server's catalog, and then rely on the import functions in the destination server to make sense of that and do whatever slicing-n-dicing is required. That being the case, I don't see a lot of value in a view -- especially not given the requirement to dump from older server versions. (Conceivably we could just say that we won't dump stats from server versions predating the introduction of this feature, but that's hardly a restriction that supports doing this via a view.) regards, tom lane