Minor question - Mailing list pgsql-novice

From Jan Danielsson
Subject Minor question
Date
Msg-id 45F130E0.6090809@gmail.com
Whole thread Raw
Responses Re: Minor question  (Phillip Smith <phillip.smith@weatherbeeta.com.au>)
List 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



Attachment

pgsql-novice by date:

Previous
From: " Jaromír Kamler"
Date:
Subject: PostgreSQL and import/export to dbf and mdb
Next
From: Phillip Smith
Date:
Subject: Re: Minor question