CURRENT_TIME - Mailing list pgsql-general

From Simeó Reig
Subject CURRENT_TIME
Date
Msg-id 001201c2858c$61587d20$0500a8c0@incofisa.com
Whole thread Raw
Responses Re: CURRENT_TIME  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Hi

I'm upgrading´a production Data Base from 7.1.3 to 7.2.3 under freeBSD

well, the problem is that now in this release CURRENT_TIME return high
precision time, is it possible to have only HH:MM:SS
its for backguards compatibility. I've tried CURRENT_TIME(0)
but it don't work in a function :

CREATE FUNCTION "set_fetxa_mod_entitat" () RETURNS opaque AS '
DECLARE
 idusuari integer;

BEGIN
        SELECT INTO idusuari idoperador from operadors WHERE nomoperador =
(CURRENT_USER)::varchar;
        NEW.horaultimamodificacio = CURRENT_TIME(0);
        NEW.fetxaultimamodificacio = CURRENT_DATE;
        NEW.idoperador = idusuari;
        IF NEW.fetxaultimamodificacio <> OLD.fetxaultimamodificacio THEN
                NEW.numeromodificacions = OLD.numeromodificacions + 1;
        END IF;
        RETURN NEW;
END;
' LANGUAGE 'plpgsql';

And the error is :

postext=# update finques set idoperador=29 where idfinca=22;
NOTICE:  Error occurred while executing PL/pgSQL function
set_fetxa_mod_finca
NOTICE:  line 6 at assignment
ERROR:  Bad time external representation '12:46:25+01'

I need only  12:46:25

Thanks a lot !




pgsql-general by date:

Previous
From: Florian Litot
Date:
Subject: i have got an error
Next
From: Andrew Sullivan
Date:
Subject: Re: Vacuum full