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

From Peter J. Holzer
Subject Re: Copying records from TABLE_A to TABLE_B (in the same database)
Date
Msg-id 20220802194157.d6uoa5mwtsg2jbd4@hjp.at
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 2022-08-02 13:08:41 -0600, Rob Sargent wrote:
>         If you can get outside sql, the bulk copy facilities (CopyManager in
>         java) is blindingly fast for me.
>
>
>     ??
>
>
> I meant using tools other than sql (and psql).   I have java code using
> org.postgresql.copy package

I don't know that package but I'm pretty sure it's just using the
PostgreSQL COPY command.

> because straight insert was too slow for large numbers of rows.

The OP already has the data in the database. In my experience[1] copying
from one table to another is quite a bit faster that copying into the
database (and therefore also copying out AND copying in).

        hp

[1] https://github.com/hjp/dbbench/blob/master/import_pg_comparison/results/akran.2019-12-15/results.png


--
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Attachment

pgsql-general by date:

Previous
From: Rob Sargent
Date:
Subject: Re: Copying records from TABLE_A to TABLE_B (in the same database)
Next
From: Thomas Munro
Date:
Subject: Re: Strange collation names ("hu_HU.UTF-8")