Search code examples
c#postgresqlnpgsql

Add table on DB when another user has a transaction open


Working at the same project, it happens that some programmers are testing the sw (using transaction), while others want to create or alter tables.

When the second group launch a "CREATE TABLE", the query keeps working until all transaction are closed.

Is there any way to succesfully launch a CREATE query while other user are in transaction?

We are using postgresql for DB and c# with Npgsql for the sw.


Solution

  • Concurrent CREATE TABLEs should not interfere with each other, unless they are trying to use the same name for the incipient tables. If they are using different names and still blocking, then you need to describe in more detail what these other transactions are doing. You can monitor locks to see exactly what is getting blocked by what.