Paulo Santos (psantos(at)wit-software(dot)com) reports a bug with a severity of 2
The lower the number the more severe it is.
Bug with inserts and rules on inserts in Postgres 7.2.1-3
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.
No file was uploaded with this report
pgsql-bugs by date
|Next:||From: Pavel Shmidt||Date: 2002-08-30 20:25:04|
|Subject: Please, help me!|
|Previous:||From: Tom Lane||Date: 2002-08-30 14:50:51|
|Subject: Re: Please, help me! |