Re: timestamp value

Поиск
Список
Период
Сортировка
От Ivan Horvath
Тема Re: timestamp value
Дата
Msg-id 20020304074549.55032.qmail@web14706.mail.yahoo.com
обсуждение исходный текст
Ответ на Re: timestamp value  ("Josh Berkus" <josh@agliodbs.com>)
Ответы Re: timestamp value  (Oliver Elphick <olly@lfix.co.uk>)
Список pgsql-novice
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 <josh@agliodbs.com> 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