[Qgis-user] Recover a project stored in a PostGIS database?

Jorge Gustavo Rocha jgr at geomaster.pt
Wed Jun 19 12:56:49 PDT 2024


Hi, Export the project from the database to the file system: copy  (SELECT  encode(content,  'hex')  FROM  public.qgis_projects  where  name  =  'my_project')  to   '/tmp/project.hex'; cd  /tmp
xxd -p -r project.hex > project.qgz

I hope it helps,

Jorge

On 19/06/24 19:56, Thayer Young via QGIS-User wrote:
> I am wondering if anyone has any ideas of how I can recover a project 
> that is stored in a PostGIS database. When I try to open the project 
> it loads indefinitely (I shut it off after a few hours) for a project 
> that used to load in a minute or so. There is no network activity to 
> suggest that the loading is due to data transfer, etc.. The individual 
> layers load from the database without any problem, so I don't think it 
> is a question of the connection.
>
> I tried the following query
>
> SELECT "name",
>     convert_from(decode(encode(qgis_projects.content, 
> 'escape'),'escape'), 'Latin1') AS project_latin1,
>     encode(qgis_projects.content, 'escape') AS project_hex
> FROM qgis_projects
> WHERE "name" = 'my_project'
>
> but with Latin1 and UTF8 I get an error stating
> ERROR: invalid byte sequence for encoding "UTF8": 0x00 SQL state: 22021
>
> -Thayer
>
> _______________________________________________
> QGIS-User mailing list
> QGIS-User at lists.osgeo.org
> List info:https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe:https://lists.osgeo.org/mailman/listinfo/qgis-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20240619/9f82b94e/attachment.htm>


More information about the QGIS-User mailing list