Error using PostgreSQL as database backend with Gramps v5.2.2

It would be interesting to know what parts of Gramps suffer from performance issues that irritate you most as a user. Perhaps we should start a separate thread to discuss this further.

1 Like

Agreed. Iā€™ll post my test results in a new thread.

2 Likes

Philip Wharram (@comeng) created a separate thread:

Agree! but I will anyway squeeze in a few more repliesā€¦

Agree, itā€™s just that Iā€™m more comfortable writing SQL queries than coding python.

I want to learn how to use the JSON functions and find out which kinds of queries, if any, might be easier to code that way. Or, even if they are not too much more difficult, there would still be the benefit that no export would be required.

Yes, I could learn to do that. All I really want is an already-converted copy of the ā€œexampleā€ database, or any other sample.

But before I do that, Iā€™m coming back to the initial error with PostgreSQL. After playing around a bit I noticed that the error comes back when trying to access another tree. The sequence is:

(1) I work with a tree in 5.2.2 on PostgreSQL.

(2) I want to open an already existing another tree in 5.2.2 on PostgreSQL. This tree has been worked with before so I know for sure that the tree is ok and can be accessed.

(3) I enter the PostgreSQL user-id/password and the old error (some byte position) pops up.

(4) I will not help if I restart Gramps. If I check the open connections with the PostgreSQL server in pgAdmin, I see that a session for the old tree is still open though it should automatically be shut down when trying to open another tree or when closing Gramps (at least thatā€™s what Iā€™d assume).

(5) In that situation pgAdmin says that a query from the old session is still running:

/*pga4dash*/
SELECT 'session_stats' AS chart_name, pg_catalog.row_to_json(t) AS chart_data
FROM (SELECT
   (SELECT count(*) FROM pg_catalog.pg_stat_activity WHERE datname = (SELECT datname FROM pg_catalog.pg_database WHERE oid = 117574)) AS "Total",
   (SELECT count(*) FROM pg_catalog.pg_stat_activity WHERE state = 'active' AND datname = (SELECT datname FROM pg_catalog.pg_database WHERE oid = 117574))  AS "Active",
   (SELECT count(*) FROM pg_catalog.pg_stat_activity WHERE state = 'idle' AND datname = (SELECT datname FROM pg_catalog.pg_database WHERE oid = 117574))  AS "Idle"
) t
UNION ALL
SELECT 'tps_stats' AS chart_name, pg_catalog.row_to_json(t) AS chart_data
FROM (SELECT
   (SELECT sum(xact_commit) + sum(xact_rollback) FROM pg_catalog.pg_stat_database WHERE datname = (SELECT datname FROM pg_catalog.pg_database WHERE oid = 117574)) AS "Transactions",
   (SELECT sum(xact_commit) FROM pg_catalog.pg_stat_database WHERE datname = (SELECT datname FROM pg_catalog.pg_database WHERE oid = 117574)) AS "Commits",

It doesnā€™t help if I kill that session in pgAdmin.

(6) It doesnā€™t help either if I stop the PostgreSQL service completely and restart it. So it appears that only a full reboot will help.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.