ciur / papermerge

Open Source Document Management System for Digital Archives (Scanned Documents)
https://papermerge.com
Apache License 2.0
2.42k stars 258 forks source link

Restore command fails when using PostgreSQL #514

Closed ciur closed 1 year ago

ciur commented 1 year ago

Backend version: 2.1.5

When running "restore" command and DB is PostgreSQL, restore fails with "ERROR: recursive query "tree" column [...] has type varchar(200) in non-recursive term but type character varying overall":

docker compose --env-file env.docker-compose run backend restore /backup/backup_04_02_2023-08_30_51.tar.gz

In order to fix the problem, SQL column needs to be casted to correct type. Note the ANSI SQL compatible syntax (x::type, is PostgreSQL specific syntax, while CAST(x as type) is ANSI SQL).

ciur commented 1 year ago

Fix: https://github.com/papermerge/papermerge-core/pull/118