Re: insert vs. copy in pgAdmin

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: "Schlaffer, Sharon" <Sharon(dot)Schlaffer(at)nrl(dot)navy(dot)mil>, "pgsql-novice(at)lists(dot)postgresql(dot)org" <pgsql-novice(at)lists(dot)postgresql(dot)org>
Subject: Re: insert vs. copy in pgAdmin
Date: 2020-08-28 11:32:08
Message-ID: beb50dc09b5bd1066863834f73639079f0044610.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-novice

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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Nicholas Chammas 2020-08-31 17:31:52 Amazon RDS auth tokens in .pgpass
Previous Message Anjul Tyagi 2020-08-28 05:24:22 Re: Logical Replication - Rep Manager

Browse pgsql-novice by date

  From Date Subject
Next Message pgsql-novice 2020-08-28 11:47:40 SOLVED: can't create table on new db/schema/user
Previous Message psql-contact 2020-08-28 11:28:35 Re: can't create table on new db/schema/user