[Pgsql-ayuda] Integridad referencial

Rafa Rodriguez Hernandez rhernandez@prisacom.com
Wed, 25 Feb 2004 18:08:40 +0100


Gracias por la ayuda, me ha sido muy util.

Un saludo.

Recuerdo que era 25 Feb 2004 11:01:46 -0600 y Manuel Sugawara <masm@fciencias.unam.mx> tecleo:

> Rafa Rodriguez Hernandez <rhernandez@prisacom.com> writes:
> 
> > Hola,
> > 
> > Necesito si alguno sabeis, como desactivar la integridad referencial,
> > volcar un dump y volver a activa dicha integridad.
> > 
> > Me podeis decir mas o menos como llevarlo a cabo? Necesito medir el tiempo
> > que tardo en hacerlo.
> 
> Para desactivarlos pg_dump hace algo como:
> 
>   UPDATE pg_class SET reltriggers = 0 WHERE relname !~ 'pg_';
> 
> y para activarlos de nuevo algo como:
> 
>   UPDATE pg_class SET reltriggers = (SELECT count(*) FROM pg_trigger where pg_class.oid = tgrelid) WHERE relname !~ '^pg_'
> 
> Nota que esto desactiva *todos* los triggers, en particular aquellos
> que se encargan de mantener la integridad referencial.
> 
> Saludos,
> Manuel.




============================================================================
This e-mail message and any attached files are intended SOLELY for the addressee/s identified herein. It may contain CONFIDENTIAL and/or LEGALLY PRIVILEGED  information and may not necessarily represent the opinion of this company. If you receive this message in ERROR, please immediately notify the sender and DELETE it since you ARE NOT AUTHORIZED  to use, disclose, distribute, print or copy all or part of the contained information. Thank you.  
============================================================================