pg_dump -F d
will result in multiple <number>.dat.gz
files which represent the object number in the database.
I wish pg_dump
create those files in the format <table name>.dat.gz
instead so I'll be able to easy distinguish a file/table in a case of table recoery.
1 Answer
There is no built in way to do this. You would have to change the code to do what you want. Or you could script something to rename the files based on the output of pg_restore -l .
Whatever you come up with wouldn't be very general. For example, what if <table name>.dat.gz
is not a legal file name on your file system?
-
-
Yes. I assumed you didn't want to use pg_restore, but some manual process. If you want to use pg_restore, then you would just use -l and -L to do what you want directly without ever looking at the *.dat.gz flies themselves. You could add symlinks from the table names to the dat.gz files rather than renaming them, if you want to not break pg_restore yet still have an easier way to inspect the files manually.– jjanesJul 29, 2018 at 16:26
-
While technically correct, the problem remains unsolved. "What is <table name> is not a legal filename on your filesystem" is an interesting idea that could have had a workaround, as every system has had to deal with. Is there no way to get table names from these obscure object-ids?– OtheusAug 22 at 8:50