i created a small stored procedure to test how fast is
pgsql, and how the now() as timestamp function is
but i recognized something strange!!!
i created a table with the following command:
CREATE TABLE "ms_hist" (
"msh_id" int4 DEFAULT nextval('seq_ms_hist'::text)
"mod_date" timestamptz DEFAULT now() NOT NULL,
CONSTRAINT "ms_hist_pk" PRIMARY KEY ("msh_id")
) WITH OIDS;
i have a sequence as well:
CREATE SEQUENCE "seq_ms_hist" INCREMENT 1 MINVALUE 1
MAXVALUE 9223372036854775807 CACHE 1;
and here is the stored procedure:
CREATE FUNCTION "test_time1"() RETURNS "opaque" AS
for counter in 1..10000 loop
insert into ms_hist default values);
' LANGUAGE 'plpgsql';
so the function is executed but all the 10000 records
mod_date value is the same.
how this can be???
please help me!!
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
pgsql-novice by date
|Next:||From: Ivan Horvath||Date: 2002-02-18 13:39:23|
|Subject: Re: problem in executing a function |
|Previous:||From: Allan M. Wind||Date: 2002-02-17 06:18:00|
|Subject: Object Relational Mapping|