Miguel
Miguel

Reputation: 63

PGAdmin locks table

Good afternoon,

I have a problem when editing data in the pgAdmin tables for this specific database, I get a padlock in each column of the table and does not let me edit the values or add new ones, however, if you let me do it through SQL queries in the same program (PGAdmin), so I understand that it is not a permissions problem.

I attach an image of the problem in case someone can help me.

Thank you very much, best regards.

Miguel.

Problem

Problem

Upvotes: 6

Views: 9365

Answers (2)

Alvin Avanessian
Alvin Avanessian

Reputation: 94

Add a primary key column in the table.

to prevent locking in postgreSQL:

- Never add a column with a default value.
- Beware of lock queues, use lock timeouts.
- Create indexes CONCURRENTLY.
- Take aggressive locks as late as possible.
- Adding a primary key with minimal locking.
- Avoid deadlocks by ordering commands.

Upvotes: 2

Arindam Roychowdhury
Arindam Roychowdhury

Reputation: 6503

To clear what the comments are trying to say, lets say you are trying to change a column value by hand.

You got your row with this kind of query.

select username, mobilenumber from auth_user where "email" LIKE '%[email protected]%'

If you run this query, you will get a row. But, you will see a lock icon. If u want the lock to be removed, change the query to include 'id'

select id, username, mobilenumber from auth_user where "email" LIKE '%[email protected]%'

Then press F6 to save changes to db. No locks on columns

Upvotes: 5

Related Questions