Postgresql Transaction ID Not Found

左心房为你撑大大i 提交于 2020-01-01 08:03:30

问题


Whenever I am executing a query in postgresql, this is the error message I receive

Transaction ID not found in the session.

Does anyone have any idea how to resolve this? I recently created a new user, but I was unable to find documentation that even shows this as a valid error.

Additional Details: I've managed to resolve the error by re-connecting with admin credentials.

I was using PG Admin V4 with Postgres V9.6, and that was the only message appearing in any query I executed, even if it was a basic query like 'SELECT NOW()'.

At the same time, this was the error message being received by the client device (an iOS device with a AWS Lambda / NodeJS backend) :

'message' : {
  'name' : 'error',
  'length' : 114,
  'severity' : 'fatal',
  'code' : '28000',
  'file' : 'miscinit.c',
  'line' : '587',
  'routine' : 'InitializeSessionUserId'
}

回答1:


I assume you found a solution, but for anyone else that finds this post, I had the same issue and I just closed PG Admin 4 and restarted it and it cleared up.




回答2:


To anyone who has this problem, all you have to do is:

1) Reconnect to the database

2) Open a new Query Tab. (Run your query here)

You're welcome.




回答3:


Disconnecting and reconnecting to the database solved this issue for me; it wasn't necessary to exit/open PGAdmin 4 completely.




回答4:


This is not a PostgreSQL error message. It must come from something else in the stack you are using - a client driver, ORM, etc.

Please post a more detailed question with full information on the stack you're using.




回答5:


So I don't know the exact specifics of my solution, but I found this issue in the following circumstance:

  • Database user was created.
  • Role was assigned for the user.
  • A transaction was used

I'm still not entirely sure I discovered the solution of the root problem, but if others have the same scenario, it might help troubleshoot it further. If any of those three are not used, then I never encountered the issue.




回答6:


Has anyone found an explanation for this problem? I am also getting a "Transaction ID not found in the session.". It's for a long running (several days) query. I ran it on a 10% sample of my data and had no trouble, but now need to repeat the process for the full dataset. I reconnect to the database and the query appears as still active. A new idle query appears as follows:

SELECT rel.oid, rel.relname AS name,
    (SELECT count(*) FROM pg_trigger WHERE tgrelid=rel.oid AND tgisinternal = FALSE) AS triggercount,
    (SELECT count(*) FROM pg_trigger WHERE tgrelid=rel.oid AND tgisinternal = FALSE AND tgenabled = 'O') AS has_enable_triggers,
    (CASE WHEN rel.relkind = 'p' THEN true ELSE false END) AS is_partitioned
FROM pg_class rel
    WHERE rel.relkind IN ('r','s','t','p') AND rel.relnamespace = 2200::oid
    AND NOT rel.relispartition
        ORDER BY rel.relname;


来源:https://stackoverflow.com/questions/43220148/postgresql-transaction-id-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!