Copy entire row on elete

Started by Josué Maldonadoalmost 22 years ago3 messagesgeneral
Jump to latest
#1Josué Maldonado
josue@lamundial.hn

Hello list,

I use triggers with plpgsql, now I have a situation I have to copy the
entire tuple of a table before it gets deleted to another table. I
wonder if is there a way to say:

insert into c select * from OLD;

But I got this error:

ERROR: OLD used in query that is not in a rule

"No cambies la salud por la riqueza, ni la libertad por el poder."Any
idea how to get it done properly?, thanks in advance.

--
Sinceramente,
Josu� Maldonado.

#2Mike Nolan
nolan@gw.tssi.com
In reply to: Josué Maldonado (#1)
Re: Copy entire row on elete

I use triggers with plpgsql, now I have a situation I have to copy the
entire tuple of a table before it gets deleted to another table. I
wonder if is there a way to say:

If you have a unique key you could do the following:

INSERT into C select * from old_table where key = OLD.key.
--
Mike Nolan

#3Josué Maldonado
josue@lamundial.hn
In reply to: Mike Nolan (#2)
Re: Copy entire row on elete

El 06/05/2004 3:45 PM, Mike Nolan en su mensaje escribio:

I use triggers with plpgsql, now I have a situation I have to copy the
entire tuple of a table before it gets deleted to another table. I
wonder if is there a way to say:

If you have a unique key you could do the following:

INSERT into C select * from old_table where key = OLD.key.
--
Mike Nolan

Yes, that one worked fine, thanks.

--
Sinceramente,
Josu� Maldonado.