PL/Ruby timestamp problem

From: Anton Nikiforov <anton(at)nikiforov(dot)ru>
To: pgsql-general(at)postgresql(dot)org
Subject: PL/Ruby timestamp problem
Date: 2004-07-20 08:19:55
Message-ID: 40FCD5AB.5040609@nikiforov.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dear All!
I have the following problem programming PL/Ruby trigger function
The function looks like:
CREATE OR REPLACE FUNCTION control.function_log() RETURNS TRIGGER
SECURITY INVOKER AS '
data = "<LOGOPERATION>\n"
ccurrent_time = PLruby.exec("select now()",1,"value")
data += "\t<TIME>#{ccurrent_time}</TIME>\n"
data += "\t<USER>\n"
..........
PL::OK
' LANGUAGE 'plruby';

This is a strange thing but i expect to get current time but got:
<LOGOPERATION>
<TIME>Sun Jul 21 10:46:10 MSK 1974</TIME>
<USER>
..........

Is this PostgreSQL/Ruby or "device my_hands" problem? And in case the
answer is not the last from the list - could someone please help with
the solution?

--
Best regards,
Anton Nikiforov

Browse pgsql-general by date

  From Date Subject
Next Message Joost Kraaijeveld 2004-07-20 09:38:33 How to find records with the same field?
Previous Message Michal =?iso-8859-2?q?Maru=B9ka?= 2004-07-20 06:38:11 Re: PQftable insufficient for primary key determination