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
Dump/restore doesn't work (for versions 1.2.3, 1.2.4 only dump works)! #331
Comments
Updated description with new (more convenient) workaround |
I will try to reproduce it on ubuntu |
I've reproduced it on ubuntu as well (tried pg_restore from windows and from ubuntu, also tried from dbeaver) |
@borodaev it works with pg13 for me. Maybe a regression with pg14? I'll try to test if I have some time. |
@autra, did you set number of jobs > 1 in restore settings? I will also try on pg13 |
@borodaev I can't remember, sorry :-/ |
Hello!
Looks like #197 is not finished. For versions 1,2,3 and 1.2.4 (I use pg14 on win 10) I can dump DB with patches but I can't restore
How do you guys live with it?
During restore pcpatch type has a 'lazy', delayed dependency to public.pointcloud_formats table records (to pcid field of the records). This indirect dependency causes error for copy commands execution during pg_restore because pointcloud_formats can be empty at the time when copy is executing.
Sometime restore can work fine if jobs are used and pointcloud_formats gets filled before patches which use corresponding format in this table. For example with attached dump file restore error can be reproduced if no jobs used but for jobs==3 it works fine. So the problem with restore is not related to how DB was created (it can be created with new pgpc version installed with old pgpc version and upgraded then using ALTER EXTENSION)
So I found only one workaround to restore db with patches:
this works only if there are no custom types/functions/tables in public schema:
create new db test
add exts
pg_dump.exe --file "C:\temp\d_public_d.dmp" --host "localhost" --port "5432" --username "postgres" --verbose --format=c --blobs --data-only --schema=public "demolog"
pg_dump.exe --file "C:\temp\d_n_public.dmp" --host "localhost" --port "5432" --username "postgres" --verbose --format=c --blobs --exclude-schema=public "demolog"
pg_restore.exe --host "localhost" --port "5432" --username "postgres" --dbname "test" --data-only --verbose "C:\temp\d_public_d.dmp"
pg_restore.exe --host "localhost" --port "5432" --username "postgres" --dbname "test" --verbose "C:\temp\d_n_public.dmp"
db_broken.zip
update
it is possible to restore even with custom data in public - you just need to create full dump and then restore public only schema and then - the rest:
restore.cmd:
usage example:
restore localhost postgres sa test_db "c:\temp\test.dmp"
env:
SELECT version(), pc_version(), PostGIS_Version()
"PostgreSQL 14.2, compiled by Visual C++ build 1914, 64-bit" "1.2.4" "3.2 USE_GEOS=1 USE_PROJ=1 USE_STATS=1"
The text was updated successfully, but these errors were encountered: