Minor question

From: Jan Danielsson <jan(dot)m(dot)danielsson(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Minor question
Date: 2007-03-09 10:03:12
Message-ID: 45F130E0.6090809@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hello all,

If I perform an update on a table which doesn't contain any rows to
update, should I perform a rollback? I realize that the transaction is
lost when the connection is closed, but is it technically correct to do so?

I have this (psudo code):

-------------------------
UPDATE sessions SET last_access=current_time WHERE id='foo'

if crsr.rowcount == 1:
conn.commit()
else
# No entries found
conn.rollback()
-------------------------

--
Kind regards,
Jan Danielsson

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Phillip Smith 2007-03-09 10:12:20 Re: Minor question
Previous Message Achilleas Mantzios 2007-03-09 09:50:08 Re: Pg_dump and bytaA