pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Sidar López Cruz <sidarlopez@hotmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: FW: truncate error
Date: Tue, 4 Oct 2005 14:34:22 -0400
Message-ID: <20051004183422.GI7732@surnet.cl> (raw)
In-Reply-To: <BAY23-F106139BBD22CF2F37A02C8CE830@phx.gbl>
References: <20051004152142.GC6925@surnet.cl>
	<BAY23-F106139BBD22CF2F37A02C8CE830@phx.gbl>

On Tue, Oct 04, 2005 at 10:01:42AM -0600, Sidar López Cruz wrote:
> Yo primero hice truncate a la tabla derivada y luego a la tabla maestra y 
> PostgreSQL no me lo permitia, entonces hice DELETE sobre la tabla maestro y 
> si pudo borrar los registros, aun no se porque pasa eso.

Hola, el idioma de esta lista es el inglés y por lo tanto nos debemos
restringir a usar ese idioma.  Para discusiones en castellano te sugiero
la lista pgsql-es-ayuda.

Con respecto a TRUNCATE, en 8.1 se puede hacer simultáneamente a ambas
tablas:

TRUNCATE tabla_derivada, tabla_maestra;

y debería funcionar (si no funciona, es un bug, por favor reportalo).
En versiones anteriores no está permitido usar TRUNCATE en tablas que
tienen llaves foráneas, ni se permite hacer TRUNCATE en más de una
tabla simultáneamente.

-- 
Alvaro Herrera                 http://www.amazon.com/gp/registry/CTMLCN8V17R4
Essentially, you're proposing Kevlar shoes as a solution for the problem
that you want to walk around carrying a loaded gun aimed at your foot.
(Tom Lane)



view thread (4+ messages)

Message-ID: <20051004183422.GI7732@surnet.cl>
Permalink:  ../20051004183422.GI7732@surnet.cl/
Also on:    postgresql.org/message-id/20051004183422.GI7732@surnet.cl

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: alvherre@alvh.no-ip.org, sidarlopez@hotmail.com
  Subject: Re: FW: truncate error
  In-Reply-To: <20051004183422.GI7732@surnet.cl>
  References: <20051004152142.GC6925@surnet.cl> <BAY23-F106139BBD22CF2F37A02C8CE830@phx.gbl> <20051004183422.GI7732@surnet.cl>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox