'now' doesnt seem to work in stored procedure

From: HK <harikrishnan(at)midascomm(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: 'now' doesnt seem to work in stored procedure
Date: 2002-11-28 11:36:43
Message-ID: Pine.LNX.4.33.0211281649010.13771-100000@daisy.midascomm.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

hi all,
i am using postgreSQL 7.1.3 and i am new to postgres.

i have 2 queries

Query 1:
=========
I used the following commands to add pl/pgsql language to the database.

1) create function plpgsql_call_handler() returns opaque as
'/usr/lib/pgsql/plpgsql.so' language 'c';

2) create language 'plpgsql' handler plpgsql_call_handler lancompiler
'pl/pgsql';

I am able to execute stored procedures. But sometimes i get this message.

ERROR: fmgr_info: cache lookup for language 1952725 failed

After which i have to drop the database and create again.

Can anybody tell me why this happens and the remedy.

Query 2:
========
Inside a stored procedure i am using 'now' for a datetime value.
Wat happens is when the stored procedure is loaded, the 'now' is
initialised and afterwards whenever i use this procedure, the same value
is being inserted.
Is my understanding correct and am i going wrong somewhere.

the procedure i am using is

create function login (int2) returns int2 as '
DECLARE
arguserid alias for $1;

begin
insert into useraccounting (userid, logintime) values
(arguserid, 'now');

return 0;
end;
' language 'plpgsql';

Help me.

--
regards,
hari

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Henshall, Stuart - Design & Print 2002-11-28 11:42:34 Re: 'now' doesnt seem to work in stored procedure
Previous Message Oliver Elphick 2002-11-28 07:43:12 Re: Copy entire file as one field