pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Copying records from TABLE_A to TABLE_B (in the same database)
Date: Tue, 2 Aug 2022 13:42:48 -0500
Message-ID: <d4599aec-838f-deff-c903-ed2f5687b91a@gmail.com> (raw)
In-Reply-To: <0f9d8171-7b10-2e3e-50a3-a4fa3fbfc0e2@gmail.com>
References: <5adcc923-889d-bb68-5a04-60125b6f0e96@gmail.com>
	<0f9d8171-7b10-2e3e-50a3-a4fa3fbfc0e2@gmail.com>

On 8/2/22 13:41, Rob Sargent wrote:
> On 8/2/22 12:37, Ron wrote:
>> AWS RDS Postgresql 12.10
>>
>> There are no indices or constraints (except for NOT NULL) on table_a.
>>
>> The two ways that I know are:
>>     INSERT INTO table_a SELECT * FROM table_b;
>> and
>>     \COPY table_a TO '/tmp/table_a.tsv' WITH (FORMAT BINARY);
>>     \COPY table_b FROM '/tmp/table_a.tsv' WITH (FORMAT BINARY);
>>
>> Is there a faster/better way?
>>
> create view ?

No, we need separate copies.

-- 
Angular momentum makes the world go 'round.

view thread (11+ messages)  latest in thread

Message-ID: <d4599aec-838f-deff-c903-ed2f5687b91a@gmail.com>
Permalink:  ../d4599aec-838f-deff-c903-ed2f5687b91a@gmail.com/
Also on:    postgresql.org/message-id/d4599aec-838f-deff-c903-ed2f5687b91a@gmail.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: ronljohnsonjr@gmail.com
  Subject: Re: Copying records from TABLE_A to TABLE_B (in the same database)
  In-Reply-To: <d4599aec-838f-deff-c903-ed2f5687b91a@gmail.com>
  References: <5adcc923-889d-bb68-5a04-60125b6f0e96@gmail.com> <0f9d8171-7b10-2e3e-50a3-a4fa3fbfc0e2@gmail.com> <d4599aec-838f-deff-c903-ed2f5687b91a@gmail.com>

* 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