Bug #921: Default value not available in RULE - Mailing list pgsql-bugs

From pgsql-bugs@postgresql.org
Subject Bug #921: Default value not available in RULE
Date
Msg-id 20030327045335.53941475F34@postgresql.org
Whole thread Raw
Responses Re: Bug #921: Default value not available in RULE  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
A.Bhuvaneswaran (bhuvansql@myrealbox.com) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
Default value not available in RULE

Long Description
I as using postgresql 7.2.3.

The default value of a column is not available in the INSERT RULE. The same value is available in the trigger which is
triggeredbefore insert. Eventhough the rule is executed before the event, the default value of a column must be
availablein the INSERT RULE. Isn't it? 

Sample Code
test_pg=# CREATE TABLE a (id int, ctime timestamp default now());
CREATE
test_pg=# CREATE TABLE a_log (id int, ctime timestamp);
CREATE
test_pg=# CREATE RULE a_rule as on insert to a do (insert into a_log (id, ctime) values (new.id, new.ctime));
CREATE
test_pg=# INSERT INTO a VALUES (1);
INSERT 14353487 1
test_pg=# SELECT * from a;
 id |              ctime
----+----------------------------------
  1 | 2003-03-27 10:14:51.139185+05:30
(1 row)

test_pg=# SELECT * from a_log;
 id | ctime
----+-------
  1 |
(1 row)

test_pg=#


No file was uploaded with this report

pgsql-bugs by date:

Previous
From: "kallol@aworkflow.com"
Date:
Subject: PostgreSql Server Problem
Next
From: Tom Lane
Date:
Subject: Re: Bug #921: Default value not available in RULE