On Wed, Aug 16, 2017 at 7:15 PM, Andres Freund <andres@anarazel.de> wrote:
I think this entirely is the wrong approach. We shouldn't add weird check commands that require locks on pg_class, we should avoid leaving the orphaned files in the first place. I've upthread outlined approached how to do so.
And in the mean time I suppose there is no reason that the approach I have outlined cannot be used by an external program. I think it is sane to draw the line at having the db responsible for cleaning up after itself when something goes wrong and leave external programs to do after-the-fact review and cleanup.