Converting a function in C - Mailing list pgsql-admin

From Mr OCP
Subject Converting a function in C
Date
Msg-id 20011123081420.12866.qmail@web20604.mail.yahoo.com
Whole thread Raw
List pgsql-admin
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!

pgsql-admin by date:

Previous
From: Andre Schubert
Date:
Subject: [Fwd: [Zope-dev] Authentication Problem with Postgres]
Next
From: MG
Date:
Subject: table permissions