J
J
Jourloy2022-01-21 15:59:57
PostgreSQL
Jourloy, 2022-01-21 15:59:57

How to unlock columns in PostgreSQL?

There was a server, there was a database in it, there were several tables in the database itself, everything went well, but after the migration, for some reason, all the columns in one of the tables began to be blocked. I went through pgAdmin and saw something like this:
61eaaca25e47c570551668.png
And other tables have normal columns:
61eaacafa73c2937296574.png
After digging in Google, I tried many ways to get PID queries that lock the table, but all to no avail. I tried to prescribe a trite commit , but he also said that nothing is being done

I then deleted the table, created a new one with a different name, but the columns were blocked there too, I created another database and a new table there, but the columns were blocked there too. That is, at the moment there is such a situation that in any case, whatever I would not create, it all has some kind of lock by default, how to get rid of this problem?

A few obvious answers in advance:
Logged in: As administrator
Restart: For certain reasons, it is better not to do this, maybe only if nothing happens at all

select * from pg_locks;

61eaad27bac6e900874175.png
Я пробовал и pg_cancel_backend, и pg_terminate_backend, но результата ноль. Выводят true, а если снова запросить блокировки, то тоже самое, но PID другой. Есть предположение, что это мой же процесс, но я в этих знаниях слаб

select * from pg_prepared_xacts;

61eaad2f1437e007924083.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
galaxy, 2022-01-21
@Jourloy

Try adding a primary key to the table

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question