Skip site navigation (1) Skip section navigation (2)

Re: [repost] trigger update time

From: Manfred Koizar <mkoi-pg(at)aon(dot)at>
To: Rory Campbell-Lange <rory(at)campbell-lange(dot)net>
Cc: Postgresql Novice List <pgsql-novice(at)postgresql(dot)org>
Subject: Re: [repost] trigger update time
Date: 2002-06-19 12:00:26
Message-ID: b5r0hucmsfn1m1maofimbi4911jtkrefv6@4ax.com (view raw or flat)
Thread:
Lists: pgsql-novice
On Wed, 19 Jun 2002 09:36:34 +0100, Rory Campbell-Lange
<rory(at)campbell-lange(dot)net> wrote:
>I am trying to update a timestamp value in a related table using
>functions and triggers, but failing miserably!

Rory,

timestamp is not the problem.

>CREATE FUNCTION "fnTU" () RETURNS opaque AS 'BEGIN
>UPDATE a SET tstamp = new.tstamp;
>WHERE new.a_id = id;
>RETURN new;
>END' LANGUAGE 'plpgsql';
    ^
    Insert ; here!

Servus
 Manfred

In response to

Responses

pgsql-novice by date

Next:From: Tom LaneDate: 2002-06-19 13:10:32
Subject: Re: [repost] trigger update time
Previous:From: Ron JohnsonDate: 2002-06-19 10:35:38
Subject: Re: Which indexes to drop

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group