pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mr OCP <mr_ocp@yahoo.com>
To: pgsql-admin@postgresql.org
Subject: Converting a function in C
Date: Fri, 23 Nov 2001 19:14:20 +1100 (EST)
Message-ID: <20011123081420.12866.qmail@web20604.mail.yahoo.com> (raw)

Hi

Can any one please help me write the following triger
in C, your help would be much appreciated

/* Archive function */
  DROP FUNCTION fn_archive();
  CREATE FUNCTION fn_archive() RETURNS OPAQUE AS '
    BEGIN
      /* TG_OP is the function (UPDATE, DELETE,
SELECT) */
      INSERT INTO adres_archive
          VALUES
(OLD.name,OLD.adres,OLD.tel,current_user,now(),TG_OP);

      IF TG_OP = ''UPDATE''
      THEN
        NEW.modtime := ''now'';
        RETURN NEW;
      END IF;

      RETURN OLD;
    END;
  ' LANGUAGE 'plpgsql';



Tks
Mike

http://shopping.yahoo.com.au - Yahoo! Shopping
- Get organised for Christmas early this year!



Message-ID: <20011123081420.12866.qmail@web20604.mail.yahoo.com>
Permalink:  ../20011123081420.12866.qmail@web20604.mail.yahoo.com/
Also on:    postgresql.org/message-id/20011123081420.12866.qmail@web20604.mail.yahoo.com

 · 

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-admin@postgresql.org
  Cc: mr_ocp@yahoo.com
  Subject: Re: Converting a function in C
  In-Reply-To: <20011123081420.12866.qmail@web20604.mail.yahoo.com>
  References: <20011123081420.12866.qmail@web20604.mail.yahoo.com>

* 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