loop on a rule - Mailing list pgsql-sql

From Martín Marqués
Subject loop on a rule
Date
Msg-id 01080719220707.11074@bugs
Whole thread Raw
Responses Re: loop on a rule
List pgsql-sql
As I said before, I am playing around with views and rules, and found out 
that I have something wrong in one of the rules. My delete rule says 
something like this:

CREATE RULE admin_delete AS ON
DELETE TO admin_view
DO INSTEAD (  DELETE FROM carrera WHERE id_curso=old.id_curso;  DELETE FROM inscripcion WHERE carrera=old.id_curso;
DELETEFROM resol WHERE carr=old.id_curso;  DELETE FROM modalidad WHERE carrera=old.id_curso;  INSERT INTO log_carrera
(accion,tabla)VALUES ('D','carrera');
 
);

Where id_curso is an identifier to which inscripcion.carrera, resol.carr and 
modalidad.carrera are REFERENCED to.

When I try to execute a query like this:

DELETE FROM admin_view WHERE id_curso=2;

I get a lost connection and this on the log:

2001-08-07 19:08:40 DEBUG:  ProcessQuery
2001-08-07 19:08:40 DEBUG:  CommitTransactionCommand
2001-08-07 19:08:43 DEBUG:  StartTransactionCommand
2001-08-07 19:08:43 DEBUG:  query: DELETE FROM admin_view WHERE id_curso=2;
XLogFlush: rqst 0/0; wrt 0/62940168; flsh 0/62940168
XLogFlush: rqst 0/57764568; wrt 0/62940168; flsh 0/62940168
2001-08-07 19:08:44 DEBUG:  ProcessQuery
INSERT @ 0/62940168: prev 0/62940128; xprev 0/0; xid 21593; bkpb 1: Heap - 
delete: node 290095/290371; tid 0/2
/usr/local/pgsql/bin/postmaster: reaping dead processes...
/usr/local/pgsql/bin/postmaster: CleanupProc: pid 12353 exited with status 138
Server process (pid 12353) exited with status 138 at Tue Aug  7 19:08:45 2001
Terminating any active server processes...
Server processes were terminated at Tue Aug  7 19:08:45 2001
Reinitializing shared memory and semaphores
invoking IpcMemoryCreate(size=1245184)
2001-08-07 19:08:45 DEBUG:  database system was interrupted at 2001-08-07 
19:08:13 GMT
2001-08-07 19:08:45 DEBUG:  CheckPoint record at (0, 62658256)
2001-08-07 19:08:45 DEBUG:  Redo record at (0, 62610224); Undo record at (0, 
0); Shutdown FALSE
2001-08-07 19:08:45 DEBUG:  NextTransactionId: 21527; NextOid: 313116
2001-08-07 19:08:45 DEBUG:  database system was not properly shut down; 
automatic recovery in progress...
/usr/local/pgsql/bin/postmaster: ServerLoop:            handling reading 6
/usr/local/pgsql/bin/postmaster: ServerLoop:            handling reading 6
/usr/local/pgsql/bin/postmaster: ServerLoop:            handling reading 6
/usr/local/pgsql/bin/postmaster: ServerLoop:            handling reading 6
The Data Base System is starting up
/usr/local/pgsql/bin/postmaster: ServerLoop:            handling writing 62

And after that tns of REDOs (which I guess are OK). Does that ServerLoop 
belong to REDO or is it part of my problem?

Any ideas?

-- 
Cualquiera administra un NT.
Ese es el problema, que cualquiera administre.
-----------------------------------------------------------------
Martin Marques                  |        mmarques@unl.edu.ar
Programador, Administrador      |       Centro de Telematica                      Universidad Nacional
        del Litoral
 
-----------------------------------------------------------------


pgsql-sql by date:

Previous
From: Martín Marqués
Date:
Subject: Re: views and null bothering
Next
From: Tom Lane
Date:
Subject: Re: loop on a rule