Sample Header Ad - 728x90

PostgreSQL 15 Restore Failing Due to Incorrect UUID Handling in Dump

1 vote
1 answer
207 views
I'm facing an issue while restoring a PostgreSQL 15 database dump. During the restore process, I encounter the following errors:
ERROR:  trailing junk after numeric literal at or near "..."
ERROR:  invalid command \N
ERROR:  invalid command \N
.
.
.
ERROR:  out of memory
The error occurs after processing the UUIDs in the dump file. It seems that the UUIDs are being interpreted incorrectly, possibly as numeric literals, which causes subsequent issues with invalid commands like \N, leading to an out of memory error. Here is the command I'm using to create the dump:
pg_dump -h  -p 5432 -U   > new.dump
And the restore command:
psql postgresql://:@/ < new.dump
Could anyone advise on the best way to create a dump file that correctly handles UUIDs during the restore process to avoid these issues? Specifically, I want to ensure UUIDs are treated as UUIDs and not interpreted as numeric literals, which leads to the invalid commands and out of memory error. Any help or best practices would be greatly appreciated! Thanks! **Additional info:** I am restoring to a PostgreSQL 15 instance. OS and version: Debian 12 pg_dump -V returns : pg_dump (Postgresql) 16.2
Asked by Luna (11 rep)
Feb 27, 2025, 07:30 PM
Last activity: Feb 28, 2025, 08:00 PM