X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 3D739B4389B for ; Wed, 9 Jul 2003 06:41:16 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 41691-07 for ; Wed, 9 Jul 2003 03:41:01 -0300 (ADT) Received: from matrix.gatewaynet.com (unknown [217.19.69.50]) by svr1.postgresql.org (Postfix) with ESMTP id 51B4AB42166 for ; Wed, 9 Jul 2003 03:41:00 -0300 (ADT) Received: from matrix.gatewaynet.com (localhost [127.0.0.1]) by matrix.gatewaynet.com (8.12.5/8.12.5) with ESMTP id h69Bk377005882; Wed, 9 Jul 2003 09:46:03 -0200 Received: from localhost (achill@localhost) by matrix.gatewaynet.com (8.12.5/8.12.5/Submit) with ESMTP id h69Bk1Z3005878; Wed, 9 Jul 2003 09:46:02 -0200 Date: Wed, 9 Jul 2003 09:46:01 -0200 (GMT+2) From: Achilleus Mantzios To: Rudi Starcevic Cc: pgsql-sql@postgresql.org Subject: Re: Logging select statements In-Reply-To: <3F0B5927.5070705@oasis.net.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/95 X-Sequence-Number: 14209 Thats why people who want entreprise apps must use enterprise frameworks. In J2EE for instance you could use LOG4J which is sorta equivalent of syslog for java. See if there is a logging module for PHP. PgSQL has no clue of who the user is. I dont think delegating this logging task to pgSQL is a good idea. Dont get me wrong, I like and use php myself, but only when i know the exact limits of how far the specific project will go in the future. On Wed, 9 Jul 2003, Rudi Starcevic wrote: > Hi, > > I have an application where user's can view records in a short form with > their first select > and view a long form with a second select. > The first view I term an impression. > The second view I term a click. > > I'd like to log the impression's and click's. > I'm wondering which is the most effiecient way to do this. > > I know I can do it in the application, PHP, by looping through the > result set and inserting into a logging table but > am wondering if it quicker to write a rule or trigger so that each > individual select is logged into a logging table > as it's selected. > > For example: > If I have a table of 3000 row's and the user submits a query which > retrieve's 100 rows. > In the first senario I could loop through the 100, using a language PHP > or Perl, and make 100 inserts after the first select is complete. > Thus 1 select plus 100 inserts. > > Can you see a way to do this all in SQL that would be better/faster/more > efficient without using PHP/Perl ? > > Many thanks > Regards > Rudi. > > > > > > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster > -- ================================================================== Achilleus Mantzios S/W Engineer IT dept Dynacom Tankers Mngmt Nikis 4, Glyfada Athens 16610 Greece tel: +30-210-8981112 fax: +30-210-8981877 email: achill at matrix dot gatewaynet dot com mantzios at softlab dot ece dot ntua dot gr