Re: Missing inserts

From: Martín Marqués <martin(at)bugs(dot)unl(dot)edu(dot)ar>
To: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Missing inserts
Date: 2001-10-03 22:52:02
Message-ID: 20011003225204.A7EFC2AB45@bugs.unl.edu.ar
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mié 03 Oct 2001 16:43, you wrote:
> On Mar 02 Oct 2001 21:59, you wrote:
> > In 7.1.X and earlier the INSERT rules are executed _before_ the INSERT.
> > This is changed to _after_ in 7.2.
>
> This would mean...??? I haven´t had much trouble until now, so I can´t
> understand why one of the 4 inserts of the rule didn´t get through.

Sorry for answering my own mail, but I found some info.

This is my rule:

CREATE RULE admin_insert AS ON
INSERT TO admin_view
DO INSTEAD (
INSERT INTO carrera
(carrera,titulo,area,descripcion,incumbencia,director,
matricula,cupos,informes,nivel,requisitos,duracion,
categoria)
VALUES
(new.carrera,new.titulo,new.id_subarea,new.descripcion,
new.incumbencia,new.director,new.matricula,new.cupos,
new.informes,new.nivel,new.requisitos,new.duracion,
new.car_categ);

INSERT INTO inscripcion
(carrera,fecha_ini,fecha_fin,lugar)
VALUES
(currval('carrera_id_curso_seq'),new.fecha_ini,new.fecha_fin,
new.lugar);

INSERT INTO resol
(carr,numero,year,fecha)
VALUES
(currval('carrera_id_curso_seq'),new.numero,new.year,new.fecha);

INSERT INTO log_carrera (accion,tabla,id_col) VALUES
('I','carrera',currval('carrera_id_curso_seq'));
);

All inserts to the tables are done to the view (so this rule is used), but I
have 39 of a total of 142 inserts that didn't get the second insert of the
rule to go.

The question is why is this happening, and how can I fix it?

If you need logs or something, I have no problem at all.

Saludos... :-)

--
Porqué usar una base de datos relacional cualquiera,
si podés usar PostgreSQL?
-----------------------------------------------------------------
Martín Marqués | mmarques(at)unl(dot)edu(dot)ar
Programador, Administrador, DBA | Centro de Telematica
Universidad Nacional
del Litoral
-----------------------------------------------------------------

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message John Summerfield 2001-10-03 23:29:32 Re: cvs problem
Previous Message Bruce Momjian 2001-10-03 22:27:47 Re: Unicode combining characters