-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Unsupported data format" when loading certain dump files #3
Comments
Probably pgdumplib - Can you provide the first 10 bytes of with open('/tmp/bad', 'rb') as handle:
print(repr(handle.read(10)) My guess is that there's a byte sneaking it at position 0 that's giving the format detection an issue. |
There's a different error ( |
Ah, yeah, I'm not sure that I can properly detect if the file hasn't fully transferred yet just by reading stdin. So ultimately the issue here is pgdumplib assumes it has full access to the entire file, but doesn't. Out of curiosity, how are you using the library? Is such a low-level thing, I didn't think it'd see much use. |
Actually, in the test above, pgdumplib has the complete file from the start. I don't call Python until the This issue came up when I was testing pgdumplib to see if I could use it as the core of a small Python project to compare versions of a database. If that works, I have other use cases too. |
Huh, and there's no binary diff between bad and good files? Re a diff tool, I have another project, probably much bigger in scope than what you're looking to do - pglifecycle, which is what I wrote pgdumplib for. One of the key features I'm planning on is diffing and generating modification DDL based on diffs. |
The good and bad files are different; see "Update 2" in Stackoverflow #64145203. The problem is, of the 9 differences, I don't know which represent the timestamp and which represent the reason that pgdumplib cannot open the file. The diff tool project sounds interesting. For what I'm doing, I actually need the data formatted in a specific way which may be hard to do in a generic tool. |
I'm facing the same problem.
This dump was generated by Odoo: https://github.com/odoo/odoo/blob/14.0/odoo/service/db.py#L228 |
I have discovered that dump files from
pg_dump
via a pipe cannot be opened bypgdumplib
. Here is a demonstration (note the|cat
on line 4):The 2 files give an identical summary from
pg_restore -l
except for the timestamp. No errors are reported.Is this an issue with
pg_dump
orpgdumplib
?The text was updated successfully, but these errors were encountered: