Paulo Santos ([EMAIL PROTECTED]) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
Bug with inserts and rules on inserts in Postgres 7.2.1-3

Long Description
Hi!

I've a table (USERS) with three rules created.

What this rules does is to insert other values in an other table (FOLDERS). So when I 
create a user I insert three (Inbox, Sent, and Base folder) default folders for this 
user.

This rules use the new.user_id to the FK reference in the table folders to the table 
users.

I discover that if I insert using something like:
insert into users values (nextval('user_seq'), 'usera'); 
The rules will try to insert nextval('user_seq') as the FK insted of the value that 
the insert have.
So the insert in the users will get the id=1, and the three rules will have the ids: 
2, 3 and 4 that don't exist in the database.

So I can only insert data in the table users using this pseudo code:

int id = select nextval('user_seq');
insert into users (id, 'usera');

This is happening in Postgres 7.2.1-3

If you consider this a real bug and want further informations, please e-mail me and 
I'll explain this with more details.

Best Regards,
Paulo Santos

Sample Code


No file was uploaded with this report


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Reply via email to