pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oleg Bartunov <oleg@sai.msu.su>
To: pgsql-hackers@postgreSQL.org
Cc: pgsql-sql@postgreSQL.org
Subject: accumulated statistics
Date: Sun, 11 Jul 1999 21:46:04 +0400 (MSD)
Message-ID: <Pine.GSO.3.96.SK.990711212748.2043b-100000@ra> (raw)

I need  accumulated hits statistics from my web appl.  and it was looks easy 
to implement. 

Quick scenario:

1. create table hits (msg_id int4 not null primary key, hits int4);
2. in cgi script
   update hits set hits=hits+1 where msg_id = $msg_id;

But this will not works if there are no row with msg_id,
so I need to insert row before. I could do this in application
but I suspect it could be done with rules.

before I dig into rules programming I'd like to know if somebody
has already have similar rule or is there another  way to do this
in postgres. I'd prefer fast solution.

	Regards,

		Oleg


_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83





view thread (2+ messages)  latest in thread

Message-ID: <Pine.GSO.3.96.SK.990711212748.2043b-100000@ra>
Permalink:  ../Pine.GSO.3.96.SK.990711212748.2043b-100000@ra/
Also on:    postgresql.org/message-id/Pine.GSO.3.96.SK.990711212748.2043b-100000@ra

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: oleg@sai.msu.su, pgsql-hackers@postgreSQL.org
  Subject: Re: accumulated statistics
  In-Reply-To: <Pine.GSO.3.96.SK.990711212748.2043b-100000@ra>
  References: <Pine.GSO.3.96.SK.990711212748.2043b-100000@ra>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox