Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Postgresql Transaction ID Not Found

Tags:

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' } 
like image 806
Molezz Avatar asked Apr 05 '17 01:04

Molezz


People also ask

How do I find my Postgres transaction ID?

Afaik "select txid_current()" should get you the current transaction id. The column xmin for a row from any table will get you the inserting transaction id, and xmax will get you the deleting (or attempted delete) transaction id.

What is XMIN in Postgres?

xmin. The identity (transaction ID) of the inserting transaction for this row version. (A row version is an individual state of a row; each update of a row creates a new row version for the same logical row.)

Does PostgreSQL have a transaction log?

In PostgreSQL, it is also known as a transaction log. A log is a record of all the events or changes and WAL data is just a description of changes made to the actual data. So, it is 'data about data' or metadata.

How does transaction work in PostgreSQL?

PostgreSQL actually treats every SQL statement as being executed within a transaction. If you do not issue a BEGIN command, then each individual statement has an implicit BEGIN and (if successful) COMMIT wrapped around it. A group of statements surrounded by BEGIN and COMMIT is sometimes called a transaction block.


2 Answers

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.

like image 139
gignosko Avatar answered Oct 07 '22 08:10

gignosko


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.

like image 21
Joshua Rajandiran Avatar answered Oct 07 '22 09:10

Joshua Rajandiran