insert vs. copy in pgAdmin

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

insert vs. copy in pgAdmin

Schlaffer, Sharon

Hello all,

 

When I use the import (csv) into a table feature, it makes a copy. This is not working for our database folks (they need to auto-populate a date/time field and for whatever reason, cannot do this if I “copy” the csv into the db).

Is there a way to import and stipulate “insert” instead (using pgAdmin, that is).

 

Thanks,

Sharon

 

======================================================

Sharon Schlaffer

[hidden email] 

 

Reply | Threaded
Open this post in threaded view
|

Re: insert vs. copy in pgAdmin

Laurenz Albe
On Thu, 2020-08-27 at 15:59 +0000, Schlaffer, Sharon wrote:
> When I use the import (csv) into a table feature, it makes a copy. This is not working for our
>  database folks (they need to auto-populate a date/time field and for whatever reason,
>  cannot do this if I “copy” the csv into the db).

Try to get a detailed technical description of your DBAs' problems.

> Is there a way to import and stipulate “insert” instead (using pgAdmin, that is).

I don't think so.

But you can COPY to a temporary table and then use

  INSERT INTO ... SELECT ...

to populate the target table from the temporary table.

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com