| From: | Mr OCP <mr_ocp(at)yahoo(dot)com> |
|---|---|
| To: | pgsql-admin(at)postgresql(dot)org |
| Subject: | Converting a function in C |
| Date: | 2001-11-23 08:14:20 |
| Message-ID: | 20011123081420.12866.qmail@web20604.mail.yahoo.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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!
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Andre Schubert | 2001-11-23 10:08:12 | Authentication Problem with Postgres |
| Previous Message | Ludva Radomír (KM) | 2001-11-23 08:11:27 | Machine independent performance. |