pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Sai Hertz And Control Systems <sank89@sancharnet.in>
To: swampler@noao.edu
Cc: Postgres-SQL <pgsql-sql@postgresql.org>
Subject: Re: Copying rows between tables?
Date: Wed, 14 Jan 2004 00:19:56 +0530
Message-ID: <40043DD4.4090802@sancharnet.in> (raw)
In-Reply-To: <1074011028.18994.18.camel@weaver.tuc.noao.edu>
References: <1074011028.18994.18.camel@weaver.tuc.noao.edu>

Dear Steve Wampler

>I have an application where old records are archived into
>'archive' tables.  Occasionally there is a need to copy
>some of these old records into the 'active' table.
>  
>
source_table(id: bigserial,uname: char,x1: char,x2: char,x3: char,x4: char)
dest_table(id: bigserial,uname: char,x11: char,x21: char,x31: char,x41: 
char)

you will do some thing like
insert into dest_table(id,uname,x11,x21) (select id,uname,x1,x2 from 
source_table)

Shootback if this helps


Regards,
Vishal Kashyap




view thread (4+ messages)

Message-ID: <40043DD4.4090802@sancharnet.in>
Permalink:  ../40043DD4.4090802@sancharnet.in/
Also on:    postgresql.org/message-id/40043DD4.4090802@sancharnet.in

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sank89@sancharnet.in, swampler@noao.edu
  Subject: Re: Copying rows between tables?
  In-Reply-To: <40043DD4.4090802@sancharnet.in>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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