Incrimenting question

From: M Simms <grim(at)argh(dot)demon(dot)co(dot)uk>
To: pgsql-sql(at)postgresql(dot)org
Subject: Incrimenting question
Date: 1998-11-15 13:18:28
Message-ID: 199811151318.NAA21545@argh.demon.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Postgres DBA 1998-11-15 14:04:08 Re: [SQL] abusing an aggregate funct
Previous Message Herouth Maoz 1998-11-15 12:19:00 Re: [SQL] Some questions