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

Re: Re: Date of creation and of change

From: hlefebvre <hlefebvre(at)lexbase(dot)net>
To: Andreas Tille <tillea(at)rki(dot)de>
Cc: PostgreSQL SQL <pgsql-sql(at)hub(dot)org>
Subject: Re: Re: Date of creation and of change
Date: 2000-08-25 14:18:32
Message-ID: 39A68038.9783106@lexbase.net (view raw or flat)
Thread:
Lists: pgsql-sql

Andreas Tille wrote:
> 
> On Fri, 25 Aug 2000, hlefebvre wrote:
> 
> > No I suppose that the problem is the identifier "changedat" is unknown.
> >
> > You must probably prefix it : NEW.changedat
> >
> >  CREATE FUNCTION changed_at_timestamp() RETURNS OPAQUE AS '
> >      BEGIN
> >          NEW.ChangedAt := timestamp(''now'');
> >          RETURN NEW;
> >      END;
> >  ' LANGUAGE 'plpgsql';
> >
> > I didn't test it, but as pgSQL looks like Oracle, it should be ok :-)
> This avoids the error message, but doesn't have any effect to the value
> of ChangedAt.  It just remains the same as CreatedAt :-(.
> 

I tried... 
I fact it seems that it doesn'nt work if you don't use the changedat
column in your UPDATE our insert statement. Just put null, and it will
be ok I think.

In response to

pgsql-sql by date

Next:From: hlefebvreDate: 2000-08-25 14:46:36
Subject: Re: Re: Date of creation and of change
Previous:From: Tom LaneDate: 2000-08-25 14:14:48
Subject: Re: Re: Date of creation and of change

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