[SQL] How can I know if a row is Locked?

2007-04-13 Thread Carlos Santos
How can I know if a row is locked by another transaction. I have in a transaction like that: BEGIN; SELECT * FROM compels.teste WHERE id = '1' FOR UPDATE; PS1: where id is the primary key. PS2: The COMMIT command is done after a long time. In this case the row with the primary-key equals to '1'

[SQL] LOCK command inside a TRANSACTION

2007-04-03 Thread Carlos Santos
Hi! I need Postgresql somehow does this for me: - if an user query a select on a table, the rows of the table in the result of this select can not be updated or deleted by another user until this one update, delete or discard the changes on those rows. I've found something about the LOCK command

[SQL] Query a select that returns all the fields of an specific value of primary key without knownig the name of the single column's primary key?

2006-12-19 Thread Carlos Santos
Hi! I need to query a select that returns all the fields of an specific primary key, but I don't have the single column's name that is constrained as primary key. How can I do that? Something like: SELECT * FROM myTable WHERE myTable.pkey = 'foo'; Thanks Carlos Henrique Iazzetti Santos Compe

Res: [SQL] SELECT with WHERE clause by column number

2006-12-18 Thread Carlos Santos
All my columns have the same data type: text. So it's much easier. Carlos Henrique Iazzetti Santos Compels Informática Santa Rita do Sapucaí - MG www.compels.net - Mensagem original De: Richard Huxton Para: Carlos Santos <[EMAIL PROTECTED]> Cc: Lista PostgreSQL SQ

[SQL] SELECT with WHERE clause by column number

2006-12-18 Thread Carlos Santos
Hi! I need to make a query like this: SELECT id FROM myTable WHERE column-number = 'value'; (PS: The id column is the primary key of myTable). That is a select using column number in the WHERE clause what don't exists in SQL. I need this because there's a situation in my program where I don't