[GH-ISSUE #514] Restore command fails when using PostgreSQL #394

Closed
opened 2026-02-25 21:31:50 +03:00 by kerem · 1 comment
Owner

Originally created by @ciur on GitHub (Feb 4, 2023).
Original GitHub issue: https://github.com/ciur/papermerge/issues/514

Originally assigned to: @ciur on GitHub.

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).

Originally created by @ciur on GitHub (Feb 4, 2023). Original GitHub issue: https://github.com/ciur/papermerge/issues/514 Originally assigned to: @ciur on GitHub. 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).
kerem 2026-02-25 21:31:50 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@ciur commented on GitHub (Feb 4, 2023):

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

<!-- gh-comment-id:1416680708 --> @ciur commented on GitHub (Feb 4, 2023): Fix: https://github.com/papermerge/papermerge-core/pull/118
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/papermerge#394
No description provided.