locks detecting

locks detecting

Postby heme » Tue 25 Jan 2005 18:34

hi,

how can i detect a lock on a table or
a lock on a row (SELECT .... FOR UPDATE)

is this the right way, if i use the property connectiontimeout,
but i think there is a better way?

thank's
heme
 

locks detecting

Postby Yuri » Wed 26 Jan 2005 16:29

Information about lock tables you can obtain from the table pg_locks.
Here you get a list of locked tables at the moment of execution the query:
Code: Select all
select pg_class.relname from pg_locks inner join pg_class on relation = pg_class.oid
where pg_class.relname <> 'pg_locks' and pg_class.relname <> 'pg_class'
Yuri
 
Posts: 140
Joined: Mon 08 Nov 2004 12:07

hi

Postby james-locksmith » Wed 03 Feb 2010 13:22

is there any way to detect keys as well
james-locksmith
 
Posts: 1
Joined: Wed 03 Feb 2010 11:24

Postby StanislavK » Thu 04 Feb 2010 10:54

Please specify the keys you mean. If, e.g., these are table primary keys, you may get their descriptions using the GetSchema method of the PgSqlConnection object:
Code: Select all
DataTable primaryKeys = pgSqlConnection1.GetSchema(PgSqlMetaDataCollectionNames.PrimaryKeys);
StanislavK
Devart Team
 
Posts: 1710
Joined: Thu 03 Dec 2009 10:48


Return to dotConnect for PostgreSQL