locks detecting

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
heme

locks detecting

Post by 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

Yuri
Posts: 140
Joined: Mon 08 Nov 2004 12:07

locks detecting

Post by 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'

james-locksmith
Posts: 1
Joined: Wed 03 Feb 2010 11:24

hi

Post by james-locksmith » Wed 03 Feb 2010 13:22

is there any way to detect keys as well

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by 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);

Post Reply