rule system oddity

From: Jaime Casanova <systemguards(at)yahoo(dot)com>
To: Bernd Helmle <bernd(dot)helmle(at)oopsware(dot)de>, pgsql hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: rule system oddity
Date: 2005-01-05 05:51:54
Message-ID: 20050105055154.21717.qmail@web50004.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,
i was doing some tests and found out this:

create table foo (
id serial not null primary key,
name text not null
);
NOTICE: CREATE TABLE will create implicit sequence
"foo_id_seq" for serial column "foo.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create
implicit index "foo_pkey" for table "foo"

i want the view show the oid of the row it shows:
create view vfoo as select oid, * from foo;

so far, so good...

-- then i create this rule

create rule insrule as on insert to vfoo
do instead
insert into foo(id, name) values (new.id, new.name);

and try an insert

insert into vfoo values(1, 'test1');
ERROR: invalid input syntax for integer: "test1"

it seems like it's trying to insert into the oid
column is that the intended behaviour? or is it a bug?
(i think is the latter). if it's a bug? where (in the
code) is the rule expanded?

regards,
Jaime Casanova

_________________________________________________________
Do You Yahoo!?
Información de Estados Unidos y América Latina, en Yahoo! Noticias.
Visítanos en http://noticias.espanol.yahoo.com

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jaime Casanova 2005-01-05 05:53:05 rule system oddity
Previous Message Oleg Bartunov 2005-01-05 04:38:00 Re: [pgsql-ru-general] [HACKERS] Final call for translation updates