Received: from www-uk-05.digiserve.com ([195.97.231.11]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f2DDYSx19864 for ; Tue, 13 Mar 2001 08:34:28 -0500 (EST) (envelope-from dev@archonet.com) Received: from mainbox.archonet.com (mwynhau.demon.co.uk [193.237.186.96]) by www-uk-05.digiserve.com (8.9.1/8.9.1) with ESMTP id NAA29248; Tue, 13 Mar 2001 13:35:19 GMT Received: from client (client.archonet.com [192.168.1.16]) by mainbox.archonet.com (Postfix) with SMTP id 572522A682; Tue, 13 Mar 2001 13:28:00 +0000 (GMT) Message-ID: <004b01c0abc1$6bd78c60$1001a8c0@archonet.com> From: "Richard Huxton" To: , References: Subject: Re: copy a record from one table to another (archive) Date: Tue, 13 Mar 2001 13:27:57 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Archive-Number: 200103/254 X-Sequence-Number: 1913 ----- Original Message ----- From: To: Sent: Tuesday, March 13, 2001 12:45 PM Subject: [SQL] copy a record from one table to another (archive) > Hello there > > Is it possible to move a record from one table to another to do a archive > with a simple command like move .... ? > begin; insert into archive_foo (select * from foo where foo_id=1); delete from foo where foo_id=1; commit; Is probably the closest you could get. Alternatively, you could wrap the above up in a function and just go: select do_archive_foo(1); - Richard Huxton