pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedtruncate error
4+ messages / 2 participants
[nested] [flat]
* truncate error
@ 2005-10-04 14:40 Sidar López Cruz <sidarlopez@hotmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Sidar López Cruz @ 2005-10-04 14:40 UTC (permalink / raw)
To: pgsql-admin
PostgreSQL 8.1 beta 2 raise error on truncating tables with foreign keys,
try this to see !!!
_________________________________________________________________
Consigue aquí las mejores y mas recientes ofertas de trabajo en América
Latina y USA: http://latam.msn.com/empleos/
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: truncate error
@ 2005-10-04 15:21 Alvaro Herrera <alvherre@alvh.no-ip.org>
parent: Sidar López Cruz <sidarlopez@hotmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Alvaro Herrera @ 2005-10-04 15:21 UTC (permalink / raw)
To: Sidar López Cruz <sidarlopez@hotmail.com>; +Cc: pgsql-admin
On Tue, Oct 04, 2005 at 08:40:31AM -0600, Sidar López Cruz wrote:
> PostgreSQL 8.1 beta 2 raise error on truncating tables with foreign keys,
> try this to see !!!
Hum, what were you trying to show us? Truncating tables with foreign
keys is supposed to work as long as you truncate the referenced table at
the same time.
--
Alvaro Herrera Valdivia, Chile ICBM: S 39º 49' 17.7", W 73º 14' 26.8"
"La felicidad no es mañana. La felicidad es ahora"
^ permalink raw reply [nested|flat] 4+ messages in thread
* FW: truncate error
@ 2005-10-04 16:01 Sidar López Cruz <sidarlopez@hotmail.com>
parent: Alvaro Herrera <alvherre@alvh.no-ip.org>
0 siblings, 1 reply; 4+ messages in thread
From: Sidar López Cruz @ 2005-10-04 16:01 UTC (permalink / raw)
To: pgsql-admin
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.
>From: Alvaro Herrera <alvherre@alvh.no-ip.org>
>To: Sidar López Cruz <sidarlopez@hotmail.com>
>CC: pgsql-admin@postgresql.org
>Subject: Re: [ADMIN] truncate error
>Date: Tue, 4 Oct 2005 11:21:42 -0400
>
>On Tue, Oct 04, 2005 at 08:40:31AM -0600, Sidar López Cruz wrote:
> > PostgreSQL 8.1 beta 2 raise error on truncating tables with foreign
>keys,
> > try this to see !!!
>
>Hum, what were you trying to show us? Truncating tables with foreign
>keys is supposed to work as long as you truncate the referenced table at
>the same time.
>
>--
>Alvaro Herrera Valdivia, Chile ICBM: S 39º 49' 17.7", W 73º 14'
>26.8"
>"La felicidad no es mañana. La felicidad es ahora"
>
>---------------------------(end of broadcast)---------------------------
>TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
_________________________________________________________________
MSN Amor: busca tu ½ naranja http://latam.msn.com/amor/
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: FW: truncate error
@ 2005-10-04 18:34 Alvaro Herrera <alvherre@alvh.no-ip.org>
parent: Sidar López Cruz <sidarlopez@hotmail.com>
0 siblings, 0 replies; 4+ messages in thread
From: Alvaro Herrera @ 2005-10-04 18:34 UTC (permalink / raw)
To: Sidar López Cruz <sidarlopez@hotmail.com>; +Cc: pgsql-admin
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)
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2005-10-04 18:34 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-10-04 14:40 truncate error Sidar López Cruz <sidarlopez@hotmail.com>
2005-10-04 15:21 ` Alvaro Herrera <alvherre@alvh.no-ip.org>
2005-10-04 16:01 ` Sidar López Cruz <sidarlopez@hotmail.com>
2005-10-04 18:34 ` Alvaro Herrera <alvherre@alvh.no-ip.org>
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