Re: Copy row from table to table

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: "Kall, Bruce A(dot)" <kall(at)mayo(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Copy row from table to table
Date: 2004-12-14 18:45:07
Message-ID: 20041214184507.GA27477@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Dec 14, 2004 at 11:48:21AM -0600, Kall, Bruce A. wrote:

> What is the easiest way to copy a particular row from one table to
> another (assuming all the columns are exactly the same). I want to
> maintain a table ('backup_table') that has rows I have (or will be)
> deleting from my 'original_table'. (Both tables have the same 68 columns).
>
> I've tried
>
> INSERT INTO backup_table SELECT * FROM original_table WHERE id='2305'

That should work if the table definitions are identical or compatible,
including column positions being the same. Didn't it work? If not,
what happened?

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Együd Csaba 2004-12-14 19:23:21 Deadlock detected during vacuum analyze
Previous Message Michael Fuhr 2004-12-14 18:15:40 Re: increasing max_connections on freebsd