Re: timestamp value

Поиск
Список
Период
Сортировка
Искать
От
Ivan Horvath
Тема
Re: timestamp value
Дата
Msg-id
20020304074549.55032.qmail@web14706.mail.yahoo.com
Ответ на
Re: timestamp value (Josh Berkus)
Список
Дерево обсуждения
timestamp value Ivan Horvath <pillesoft@yahoo.co.uk>
Re: timestamp value "Josh Berkus" <josh@agliodbs.com>
Re: timestamp value Ivan Horvath <pillesoft@yahoo.co.uk>
Re: timestamp value Oliver Elphick <olly@lfix.co.uk>
Re: timestamp value Ivan Horvath <pillesoft@yahoo.co.uk>
Re: timestamp value Oliver Elphick <olly@lfix.co.uk>
Re: timestamp value Ivan Horvath <pillesoft@yahoo.co.uk>
Thanks for answer,

here is the code of the stored procedure:

DROP FUNCTION a_function();

CREATE FUNCTION a_function () RETURNS interval AS '
DECLARE
        process_time interval;
BEGIN
        FOR i IN 1..10000 LOOP
            INSERT INTO unit (unit_name, mod_date)
VALUES (''a'', current_timestamp);
        END LOOP;

        select into process_time max(mod_date) -
min(mod_date) from unit;

        RETURN process_time;

END;'
LANGUAGE 'plpgsql';

and here is the the table structure:
 DROP SEQUENCE seq_unit;
 CREATE SEQUENCE seq_unit;

 DROP TABLE unit;
 CREATE TABLE unit (
    unit_id int4 NOT NULL default nextval('seq_unit')
CONSTRAINT unit_pk PRIMARY KEY,
    unit_name varchar(10) NOT NULL CHECK (unit_name <>
''),
    mod_user varchar(10) NOT NULL DEFAULT
current_user(),
    mod_date timestamp(0) NOT NULL
 );

thank you

Ivan

--- Josh Berkus  wrote:
> Ivan,
> 
> > i created a table, which has a field; type is
> > timestamp to store the record
> creation/modification
> > value.
> > 
> > if i fill this table from a stored procedure the
> field
> > value is always the SAME!
> 
> Please provide copies of the table and function
> schema.  You've
>  obviously made a mistake in your syntax, but nobody
> can help without
>  specifics.
> 
> -Josh 
> 
> ---------------------------(end of
> broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
> 
> http://www.postgresql.org/users-lounge/docs/faq.html


__________________________________________________
Do You Yahoo!?
Yahoo! Sports - sign up for Fantasy Baseball
http://sports.yahoo.com
В списке pgsql-novice по дате отправления
От: Josh Berkus
Дата:
Сообщение: Re: Duplicates Question
От: denis@coralindia.com
Дата:
Сообщение: Re: Duplicates Question
FAQ