Incrimenting question - Mailing list pgsql-sql

From M Simms
Subject Incrimenting question
Date
Msg-id 199811151318.NAA21545@argh.demon.co.uk
Whole thread Raw
Responses Re: [SQL] Incrimenting question  (Herouth Maoz <herouth@oumail.openu.ac.il>)
List pgsql-sql
I have a question regarding incrimenting values. I have looked but cannot find
any definite answers in the documentation.

In an example in the documentation, it is shown:

update weather set temp_hi=temp_hi-1,temp_lo=temp_lo-2
  where date > '11/28/1994';

Now, this does NOT clearly tell me how safe this action is. I am looking
for a safe way to do that that ensures that if this action is performed
twice at the same time by different people, that it WILL be incrimented
twice.

I am writing a counter for a webpage and need to know that when I do

update pagestat set hitcount=hitcount+1 where page='main';

that it will count every hit and not just drop hits if 2 people access at
the same moment. It is a very busy page.

Otherwise I am going to have to create sequences for EVERY page and thats going
to really defeat the reason for using an RDB.

Thanks in advance

pgsql-sql by date:

Previous
From: Herouth Maoz
Date:
Subject: Re: [SQL] Some questions
Next
From: Postgres DBA
Date:
Subject: Re: [SQL] abusing an aggregate funct