Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id E2B659FB5FB; Fri, 23 Mar 2007 02:47:18 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 88369-09; Fri, 23 Mar 2007 02:47:15 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from bay0-omc2-s39.bay0.hotmail.com (bay0-omc2-s39.bay0.hotmail.com [65.54.246.175]) by postgresql.org (Postfix) with ESMTP id 1770C9FB5E1; Fri, 23 Mar 2007 02:47:14 -0300 (ADT) Received: from BAY131-W8 ([65.55.136.43]) by bay0-omc2-s39.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Thu, 22 Mar 2007 22:47:13 -0700 Message-ID: Content-Type: multipart/alternative; boundary="_14e4481f-2745-4a1e-8a93-779a99f757c1_" X-Originating-IP: [67.169.184.232] From: Karthikeyan Sundaram To: Anoo Pillai , , Subject: Re: How to get the DML Commands exceuted from functions Date: Thu, 22 Mar 2007 22:47:13 -0700 Importance: Normal MIME-Version: 1.0 X-OriginalArrivalTime: 23 Mar 2007 05:47:13.0031 (UTC) FILETIME=[B49A0170:01C76D0E] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.695 tagged_above=0 required=5 tests=AWL, BAYES_20, DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, HTML_40_50, HTML_MESSAGE, SPF_PASS X-Spam-Level: X-Archive-Number: 200703/167 X-Sequence-Number: 24991 --_14e4481f-2745-4a1e-8a93-779a99f757c1_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable CREATE OR REPLACE FUNCTION xyz() returns int4 as $body$ DECLARE .... BEGIN IF (TG_OP =3D 'DELETE') THEN n_id =3D OLD.campaign_id; = EXECUTE 'DELETE FROM cn_mapping WHERE campaign_id =3D '||quote_literal(n_= id); RETURN 0; END IF; END; $body$ LANGUAGE 'plpgsql' VOLATILE; =20 Date: Fri, 23 Mar 2007 10:44:49 +0530From: anoo.postgresql@gmail.comTo: pgs= ql-admin@postgresql.org; pgsql-general@postgresql.orgSubject: [ADMIN] How t= o get the DML Commands exceuted from functions Hi All,=20 =20 There are a few plpgsql functions in our application, When the functions ar= e called, I would like to see the commands executed from the functions ( th= e selects, inserts, updates and Deletes written in the function body) =20 =20 I am from SQL server world and there exists a tool SQL Profiler for the sam= e purpose. I am looking for something like that=20 =20 =20 Thanks in advance =20 Anoo.S _________________________________________________________________ Take a break and play crossword puzzles - FREE! http://games.msn.com/en/flexicon/default.htm?icid=3Dflexicon_ wlmemailtagli= nemarch07= --_14e4481f-2745-4a1e-8a93-779a99f757c1_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable CREATE OR REPLACE FUNCTION xyz() returns int4 as
$body$
DECLARE
....
BEGIN
      IF (TG_OP =3D 'DELETE') THEN
  =        n_id =3D OLD.campaign_id;
 &nb= sp;       EXECUTE 'DELETE FROM cn_mapping WHE= RE campaign_id =3D '||quote_literal(n_id);
     = ;    RETURN 0;
      END IF;
END;
$body$
 LANGUAGE 'plpgsql' VOLATILE;


 

Date: Fri, 23 Mar 2007 10:44:49 +0530
From: anoo.postgresql@gmail.comTo: pgsql-admin@postgresql.org; pgsql-general@postgresql.org
Subject: [= ADMIN] How to get the DML Commands exceuted from functions

Hi All,
 
There are a few plpgsql functions in our application, When t= he functions are called, I would like to see the commands executed fro= m the functions ( the selects, inserts, updates and Deletes written in the = function body) 
 
I am from SQL server world and there exists a tool SQL Profiler for th= e same purpose. I am looking for something like that
 
 
Thanks in advance
 
Anoo.S


Take a break and play crossword p= uzzles - FREE! Play Now! = --_14e4481f-2745-4a1e-8a93-779a99f757c1_--