CURRENT_TIME

From: Simeó Reig <simeo(at)incofisa(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: CURRENT_TIME
Date: 2002-11-06 12:02:28
Message-ID: 001201c2858c$61587d20$0500a8c0@incofisa.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

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 !

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Sullivan 2002-11-06 12:05:07 Re: Vacuum full
Previous Message Terence Leung 2002-11-06 11:49:49 Question about foreign key

Browse pgsql-hackers by date

  From Date Subject
Next Message Achilleus Mantzios 2002-11-06 12:41:52 Problem: Referential Integrity Constraints lost
Previous Message Nicolas VERGER 2002-11-06 10:36:23 Stability problems