Re: Copying records from TABLE_A to TABLE_B (in the same database) - Mailing list pgsql-general

From Ron
Subject Re: Copying records from TABLE_A to TABLE_B (in the same database)
Date
Msg-id d4599aec-838f-deff-c903-ed2f5687b91a@gmail.com
Whole thread Raw
In response to Re: Copying records from TABLE_A to TABLE_B (in the same database)  (Rob Sargent <robjsargent@gmail.com>)
List pgsql-general
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.

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Copying records from TABLE_A to TABLE_B (in the same database)
Next
From: Thomas Kellerer
Date:
Subject: Re: Copying records from TABLE_A to TABLE_B (in the same database)