By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,918 Members | 1,557 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,918 IT Pros & Developers. It's quick & easy.

Nonrepeatable Read and Phantom Read possible?

P: 1
Hi

I'm using postgreSQL 9.3 and I have the following two types of stored procedures (only the statements given):

Expand|Select|Wrap|Line Numbers
  1. INSERT INTO table1 (col1, col2, col3, col4, col5) 
  2. SELECT $1, $2, $3, $4, $5
  3. WHERE EXISTS (SELECT id FROM table2 q WHERE q.id = $1) RETURNING table1.id;
Expand|Select|Wrap|Line Numbers
  1. DELETE FROM table1 m WHERE m.id = (
  2.     SELECT m.id FROM table1 m 
  3.     WHERE   m.col1 = $1 
  4.     AND     coalesce($2, m.col2) = m.col2
  5.     AND     coalesce(m.col3, $3) = $3 
  6.     ORDER BY m.date ASC 
  7.     LIMIT 1
  8.     FOR UPDATE
  9. ) RETURNING m.id, m.col1, m.col2, m.col3, m.col4, m.col5, m.col6;
The $x represents input to the stored procedures. I ommited the function declaration.

Is Nonrepeatable Read and Phantom Read possible with this two stored procedures?
Oct 18 '14 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.