From adivi@maximizelearning.com Thu Jul 10 05:42:08 2003 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 8342ECBF25 for ; Thu, 10 Jul 2003 05:42:08 +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 47299-09 for ; Thu, 10 Jul 2003 02:41:36 -0300 (ADT) Received: from mail.maximizelearning.com (unknown [203.129.229.163]) by svr1.postgresql.org (Postfix) with SMTP id C3C80CADC1 for ; Thu, 10 Jul 2003 02:40:45 -0300 (ADT) Received: from Comp0117 ([203.129.229.166] RDNS failed) by mail.maximizelearning.com with Microsoft SMTPSVC(5.0.2195.5329); Thu, 10 Jul 2003 11:10:41 +0530 Message-ID: <004401c346a5$bbf0bb50$5d0410ac@maximizelearning.com> From: "adivi" To: Subject: trigger proceedures in sql Date: Thu, 10 Jul 2003 11:10:12 +0530 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0041_01C346D3.D54EF070" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-OriginalArrivalTime: 10 Jul 2003 05:40:41.0411 (UTC) FILETIME=[CCAF8930:01C346A5] X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=HTML_60_70 X-Spam-Level: X-Archive-Number: 200307/123 X-Sequence-Number: 14237 This is a multi-part message in MIME format. ------=_NextPart_000_0041_01C346D3.D54EF070 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable hi, can trigger proceedures ( procedures to be executed from within a tri= gger ) not be written in sql. i was looking for examples and can find proceedures in 'c' only. regards -adivi ------=_NextPart_000_0041_01C346D3.D54EF070 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
hi,
 
      can= trigger=20 proceedures ( procedures to be executed from within a trigger )
      &nb= sp; not=20 be written in sql.
 
      i w= as=20 looking for examples and can find proceedures in 'c' only.
 
regards
-adivi
------=_NextPart_000_0041_01C346D3.D54EF070-- From davidw@unidial.com.au Thu Jul 10 08:04:30 2003 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id BA7BECC137 for ; Thu, 10 Jul 2003 08:04:30 +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 59286-08 for ; Thu, 10 Jul 2003 05:03:58 -0300 (ADT) Received: from ozimelb03.ozicom.com (unknown [203.185.247.100]) by svr1.postgresql.org (Postfix) with ESMTP id 209ADCC052 for ; Thu, 10 Jul 2003 04:56:06 -0300 (ADT) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C346B8.BEF6A0F6" Subject: Re: trigger proceedures in sql X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 Date: Thu, 10 Jul 2003 17:56:18 +1000 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [SQL] trigger proceedures in sql Thread-Index: AcNGphP8jAWtLtGDRm26mi1WLB2ADAAEeWUg From: "David Witham" To: "adivi" Cc: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/126 X-Sequence-Number: 14240 This is a multi-part message in MIME format. ------_=_NextPart_001_01C346B8.BEF6A0F6 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Adivi, =20 You can use PL/PgSQL functions with triggers. See chapter 19 of the program= mers reference: =20 http://www.postgresql.org/docs/7.3/static/plpgsql-trigger.html =20 =20 regards, David -----Original Message----- From: adivi [mailto:adivi@maximizelearning.com] Sent: Thursday, 10 July 2003 15:40 To: pgsql-sql@postgresql.org Subject: [SQL] trigger proceedures in sql hi, =20 can trigger proceedures ( procedures to be executed from within a tri= gger ) not be written in sql. =20 i was looking for examples and can find proceedures in 'c' only. =20 regards -adivi ------_=_NextPart_001_01C346B8.BEF6A0F6 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi=20 Adivi,
 
You=20 can use PL/PgSQL functions with triggers. See chapter 19 of the programmers= =20 reference:
 
htt= p://www.postgresql.org/docs/7.3/static/plpgsql-trigger.html
 
regards,
David
-----Original Message-----
From: adivi=20 [mailto:adivi@maximizelearning.com]
Sent: Thursday, 10 July 200= 3=20 15:40
To: pgsql-sql@postgresql.org
Subject: [SQL] tri= gger=20 proceedures in sql

hi,
 
      c= an=20 trigger proceedures ( procedures to be executed from within a trigger=20 )
      &= nbsp; not=20 be written in sql.
 
      i= was=20 looking for examples and can find proceedures in 'c' only.
 
regards
-adivi
------_=_NextPart_001_01C346B8.BEF6A0F6-- From dev@archonet.com Thu Jul 10 09:43:11 2003 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 32224CC5D0 for ; Thu, 10 Jul 2003 09:43:11 +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 87355-03 for ; Thu, 10 Jul 2003 06:42:38 -0300 (ADT) Received: from anchor-post-31.mail.demon.net (anchor-post-31.mail.demon.net [194.217.242.89]) by svr1.postgresql.org (Postfix) with ESMTP id 5E21ACC24E for ; Thu, 10 Jul 2003 05:29:34 -0300 (ADT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-31.mail.demon.net with esmtp (Exim 3.35 #1) id 19aWoD-000BIs-0V; Thu, 10 Jul 2003 09:29:45 +0100 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id DEFB016D61; Thu, 10 Jul 2003 09:29:41 +0100 (BST) Received: from client.archonet.com (client.archonet.com [192.168.1.16]) by mainbox.archonet.com (Postfix) with ESMTP id 394BF16D57; Thu, 10 Jul 2003 09:29:41 +0100 (BST) Content-Type: text/plain; charset="iso-8859-1" From: Richard Huxton Organization: Archonet Ltd To: "adivi" , Subject: Re: trigger proceedures in sql Date: Thu, 10 Jul 2003 09:29:47 +0100 User-Agent: KMail/1.4.3 References: <004401c346a5$bbf0bb50$5d0410ac@maximizelearning.com> In-Reply-To: <004401c346a5$bbf0bb50$5d0410ac@maximizelearning.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200307100929.47140.dev@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/128 X-Sequence-Number: 14242 On Thursday 10 Jul 2003 6:40 am, adivi wrote: > hi, > > can trigger proceedures ( procedures to be executed from within a > trigger ) not be written in sql. > > i was looking for examples and can find proceedures in 'c' only. AFAIK you can't use "sql", but you can use "plpgsql". There is an example o= f a=20 trigger function in the docs (chapter "Procedural Languages"). Also check o= ut=20 http://techdocs.postgresql.org/ - there are examples in some of the docs=20 there. --=20 Richard Huxton From sszabo@megazone23.bigpanda.com Fri Jul 11 05:46:39 2003 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id CA024CC168 for ; Fri, 11 Jul 2003 05:46:39 +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 12944-07 for ; Fri, 11 Jul 2003 02:46:28 -0300 (ADT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by svr1.postgresql.org (Postfix) with ESMTP id 9ACC4CD586 for ; Thu, 10 Jul 2003 11:27:04 -0300 (ADT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id ADE91D61B; Thu, 10 Jul 2003 07:27:18 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id A3A2B5C0D; Thu, 10 Jul 2003 07:27:18 -0700 (PDT) Date: Thu, 10 Jul 2003 07:27:18 -0700 (PDT) From: Stephan Szabo To: adivi Cc: Subject: Re: trigger proceedures in sql In-Reply-To: <004401c346a5$bbf0bb50$5d0410ac@maximizelearning.com> Message-ID: <20030710072543.O35479-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/137 X-Sequence-Number: 14251 On Thu, 10 Jul 2003, adivi wrote: > can trigger proceedures ( procedures to be executed from within a trigger ) > not be written in sql. AFAICT, no, sql functions cannot return opaque/trigger. However you can write trigger functions in most/all of the pl languages (plpgsql, pltcl, etc...) I think the trigger examples for plpgsql are in plpgsql's documentation. From scott.marlowe@ihs.com Fri Jul 11 02:00:25 2003 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 391FECD699 for ; Fri, 11 Jul 2003 02:00:25 +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 38495-07 for ; Thu, 10 Jul 2003 23:00:13 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id 6547CCB687 for ; Thu, 10 Jul 2003 12:55:59 -0300 (ADT) Received: from css120.ihs.com (css120.ihs.com [170.207.105.120]) by mail1.ihs.com (8.12.9/8.12.9) with ESMTP id h6AFsjRo005329; Thu, 10 Jul 2003 09:54:46 -0600 (MDT) Date: Thu, 10 Jul 2003 09:47:57 -0600 (MDT) From: "scott.marlowe" To: adivi Cc: Subject: Re: trigger proceedures in sql In-Reply-To: <004401c346a5$bbf0bb50$5d0410ac@maximizelearning.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner: Found to be clean X-MailScanner-SpamCheck: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/136 X-Sequence-Number: 14250 On Thu, 10 Jul 2003, adivi wrote: > hi, > > can trigger proceedures ( procedures to be executed from within a trigger ) > not be written in sql. > > i was looking for examples and can find proceedures in 'c' only. they can be written in pl/pgsql for sure, as I've written a few. :-) Here's the section in the developer docs on triggers in plpgsql: http://developer.postgresql.org/docs/postgres/plpgsql-trigger.html From jgardner@jonathangardner.net Fri Jul 11 09:23:38 2003 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id D30ABCE518 for ; Fri, 11 Jul 2003 09:23:38 +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 87741-01 for ; Fri, 11 Jul 2003 06:23:26 -0300 (ADT) Received: from irko.smoothcorp.com (unknown [208.49.241.41]) by svr1.postgresql.org (Postfix) with ESMTP id E4433CE837 for ; Thu, 10 Jul 2003 16:15:53 -0300 (ADT) Received: from jgardner.ifloor.com ([10.0.1.63]) by irko.smoothcorp.com with esmtp (Exim 4.12) id 19agtj-0007iu-00; Thu, 10 Jul 2003 12:16:07 -0700 Received: from jgardner.ifloor.com (localhost.localdomain [127.0.0.1]) by jgardner.ifloor.com (8.12.8/8.12.8) with ESMTP id h6AJG8HK019481; Thu, 10 Jul 2003 12:16:08 -0700 Received: from localhost (localhost [[UNIX: localhost]]) by jgardner.ifloor.com (8.12.8/8.12.8/Submit) id h6AJG8SF019479; Thu, 10 Jul 2003 12:16:08 -0700 From: Jonathan Gardner To: "adivi" , Subject: Re: trigger proceedures in sql Date: Thu, 10 Jul 2003 12:16:06 -0700 User-Agent: KMail/1.5 References: <004401c346a5$bbf0bb50$5d0410ac@maximizelearning.com> In-Reply-To: <004401c346a5$bbf0bb50$5d0410ac@maximizelearning.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Description: clearsigned data Content-Disposition: inline Message-Id: <200307101216.07977.jgardner@jonathangardner.net> X-SA-Exim-Rcpt-To: adivi@maximizelearning.com, pgsql-sql@postgresql.org X-SA-Exim-Scanned: No; SAEximRunCond expanded to false X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/142 X-Sequence-Number: 14256 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wednesday 09 July 2003 22:40, adivi wrote: > hi, > > can trigger proceedures ( procedures to be executed from within a > trigger ) not be written in sql. > > i was looking for examples and can find proceedures in 'c' only. > You may write them in PL/pgSQL, PL/Python, etc... Each language has example= s=20 on how to set up triggers. So you will need to read about PL/pgSQL and=20 PL/Python to figure out how to write triggers in those languages. I don't think you can write triggers in pure SQL. - --=20 Jonathan Gardner (was jgardn@alumni.washington.edu) Live Free, Use Linux! -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/Dbt3WgwF3QvpWNwRAiRvAJ4ojWIGRGeuTQHY5ckOnepy0LBu9gCgoTl1 XaM7clW3uelccH/w0iaAA/k=3D =3DR7do -----END PGP SIGNATURE----- From mallah@trade-india.com Sun Jul 13 06:31:24 2003 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.192]) by svr1.postgresql.org (Postfix) with ESMTP id 63705CB8FE for ; Sun, 13 Jul 2003 06:31:24 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr4.postgresql.org [64.117.224.192]) (amavisd-new, port 10024) with ESMTP id 47856-01 for ; Sun, 13 Jul 2003 06:31:13 +0000 (GMT) Received: from rtlocal.trade-india.com (mail-relay.trade-india.com [203.196.129.235]) by svr1.postgresql.org (Postfix) with SMTP id 6C2F0CB8F9 for ; Sun, 13 Jul 2003 03:30:49 -0300 (ADT) Received: (qmail 26960 invoked from network); 13 Jul 2003 06:39:03 -0000 Received: from unknown (HELO system67.trade-india-local.com) (unknown) by unknown with SMTP; 13 Jul 2003 06:39:03 -0000 From: Rajesh Kumar Mallah Organization: Infocom Network Limited To: "adivi" , Subject: Re: trigger proceedures in sql Date: Sun, 13 Jul 2003 12:01:06 +0530 User-Agent: KMail/1.5.1 References: <004401c346a5$bbf0bb50$5d0410ac@maximizelearning.com> In-Reply-To: <004401c346a5$bbf0bb50$5d0410ac@maximizelearning.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200307131201.06850.mallah@trade-india.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/151 X-Sequence-Number: 14265 Yes of course! contrib/dbmirror does execute a procedure written in 'C' called recordchange() ON update , insert , delete. If you need help in getting its source lemme know. regds Mallah. On Thursday 10 Jul 2003 11:10 am, adivi wrote: > hi, > > can trigger proceedures ( procedures to be executed from within a > trigger ) not be written in sql. > > i was looking for examples and can find proceedures in 'c' only. > > regards > -adivi From JanWieck@Yahoo.com Sun Jul 13 12:04:17 2003 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.225.181]) by svr1.postgresql.org (Postfix) with ESMTP id C2525CB9F5 for ; Sun, 13 Jul 2003 12:04:17 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr5.postgresql.org [64.117.225.181]) (amavisd-new, port 10024) with ESMTP id 67909-02 for ; Sun, 13 Jul 2003 12:04:35 +0000 (GMT) Received: from europa.janwieck.net (h00045a2e4e7c.ne.client2.attbi.com [24.131.181.55]) by svr1.postgresql.org (Postfix) with ESMTP id 8C4F9CB908 for ; Sun, 13 Jul 2003 09:04:15 -0300 (ADT) Received: from Yahoo.com (pD9575330.dip.t-dialin.net [217.87.83.48]) (authenticated) by europa.janwieck.net (8.11.6/8.11.6) with ESMTP id h6DC41c20480; Sun, 13 Jul 2003 08:04:01 -0400 Message-ID: <3F114A7A.2090904@Yahoo.com> Date: Sun, 13 Jul 2003 08:03:06 -0400 From: Jan Wieck Organization: Unorganized User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Rajesh Kumar Mallah Cc: adivi , pgsql-sql@postgresql.org Subject: Re: trigger proceedures in sql References: <004401c346a5$bbf0bb50$5d0410ac@maximizelearning.com> <200307131201.06850.mallah@trade-india.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=1.9 tagged_above=0.0 required=5.0 tests=EMAIL_ATTRIBUTION, QUOTED_EMAIL_TEXT, RCVD_FAKE_HELO_DOTCOM_2, RCVD_IN_NJABL, RCVD_IN_OSIRUSOFT_COM, REFERENCES, REPLY_WITH_QUOTES, USER_AGENT_MOZILLA_UA, X_ACCEPT_LANG, X_NJABL_DIALUP X-Spam-Level: * X-Archive-Number: 200307/154 X-Sequence-Number: 14268 Rajesh Kumar Mallah wrote: > > Yes of course! > contrib/dbmirror does execute a procedure written in 'C' > called recordchange() ON update , insert , delete. > If you need help in getting its source lemme know. > > regds > Mallah. > > On Thursday 10 Jul 2003 11:10 am, adivi wrote: >> hi, >> >> can trigger proceedures ( procedures to be executed from within a >> trigger ) not be written in sql. >> >> i was looking for examples and can find proceedures in 'c' only. Trigger procedures can also be written in many procedural languages like PL/Perl, PL/Tcl and PL/pgSQL (what you should be looking at closer). Examples for PL/pgSQL can be found in the regression test. Jan -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #================================================== JanWieck@Yahoo.com #