PL/Ruby timestamp problem - Mailing list pgsql-general

From Anton Nikiforov
Subject PL/Ruby timestamp problem
Date
Msg-id 40FCD5AB.5040609@nikiforov.ru
Whole thread Raw
List 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

Attachment

pgsql-general by date:

Previous
From: mmc@maruska.dyndns.org (Michal Maruška)
Date:
Subject: Re: PQftable insufficient for primary key determination
Next
From: "Joost Kraaijeveld"
Date:
Subject: How to find records with the same field?