Re: [GENERAL] delete with index scan

2004-11-30 Thread Sally Ruggero
Thank you so much, I guess my sql skills need sharpening. I have been trying
all night to find out how to do a join with delete. I thought I needed to
mention t2 in the from clause, but that didn't work. This worked great.

Sally

- Original Message - 
From: Martijn van Oosterhout [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, November 30, 2004 10:38 AM
Subject: Re: [GENERAL] delete with index scan




---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


[GENERAL] Recommended Procedure for Archiving Table Data

2004-10-29 Thread Sally Ruggero




I need advice on archiving data from our production 
database. 

Each night I would like tosave and remove 
aday's data from two weeks ago, from all the tables. I know how to delete 
the data--though our schema does not specify cascaded deletes. However, I can't 
figure out how to save the desired data. I'd like tosave itin SQL 
insert statement format, but I can't see how to get the data out. If I use psql 
to create a temp table with the old data in it, then the table disappears when I 
exit psql and I can't dump it with pg_dump. If I make a new table and put the 
data in it, then when I dump it with pg_dump, all the insert statements have the 
new table name rather than the original tablename. I'm sure there's a good 
solution for this standard problem. Does anyone have a suggestion?

Thanks,
Sally