Copying records from TABLE_A to TABLE_B (in the same database)

From: Ron <ronljohnsonjr(at)gmail(dot)com>
To: pgsql-general list <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Copying records from TABLE_A to TABLE_B (in the same database)
Date: 2022-08-02 18:37:38
Message-ID: 5adcc923-889d-bb68-5a04-60125b6f0e96@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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?

--
Angular momentum makes the world go 'round.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rob Sargent 2022-08-02 18:41:00 Re: Copying records from TABLE_A to TABLE_B (in the same database)
Previous Message jian he 2022-08-02 14:38:58 ICU is not supported in this build. install from source code.