pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
insert vs. copy in pgAdmin
3+ messages / 2 participants
[nested] [flat]

* insert vs. copy in pgAdmin
@ 2020-08-27 15:59  Schlaffer, Sharon <Sharon.Schlaffer@nrl.navy.mil>
  0 siblings, 2 replies; 3+ messages in thread

From: Schlaffer, Sharon @ 2020-08-27 15:59 UTC (permalink / raw)
  To: pgsql-novice@lists.postgresql.org <pgsql-novice@lists.postgresql.org>

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
sharon.schlaffer@nrl.navy.mil




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* insert vs. copy in pgAdmin
@ 2020-08-27 16:07  Schlaffer, Sharon <Sharon.Schlaffer@nrl.navy.mil>
  parent: Schlaffer, Sharon <Sharon.Schlaffer@nrl.navy.mil>
  1 sibling, 0 replies; 3+ messages in thread

From: Schlaffer, Sharon @ 2020-08-27 16:07 UTC (permalink / raw)
  To: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>

Apologies for possibly “cross-listing” (there is a reason I subscribed to the list entitled, “novice” ; )

I think I should have directed my pgAdmin question to this list:

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
Naval Research Laboratory - Code 8111
Naval Center for Space Technology, Technical Staff
4555 Overlook Ave. SW. Washington, DC 20375-5000
Tel:  202-329-4648 (Mobile); 301-585-6116 (Home)
sharon.schlaffer@nrl.navy.mil<mailto:sharon.schlaffer@nrl.navy.mil>
& ShoreshNeg1@gmail.com<mailto:ShoreshNeg1@gmail.com>


From: Sharon Schlaffer <Sharon.Schlaffer@nrl.navy.mil>
Date: Thursday, August 27, 2020 at 11:59 AM
To: "pgsql-novice@lists.postgresql.org" <pgsql-novice@lists.postgresql.org>
Subject: insert vs. copy in pgAdmin

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
sharon.schlaffer@nrl.navy.mil





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: insert vs. copy in pgAdmin
@ 2020-08-28 11:32  Laurenz Albe <laurenz.albe@cybertec.at>
  parent: Schlaffer, Sharon <Sharon.Schlaffer@nrl.navy.mil>
  1 sibling, 0 replies; 3+ messages in thread

From: Laurenz Albe @ 2020-08-28 11:32 UTC (permalink / raw)
  To: Schlaffer, Sharon <Sharon.Schlaffer@nrl.navy.mil>; pgsql-novice@lists.postgresql.org <pgsql-novice@lists.postgresql.org>

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






^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2020-08-28 11:32 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-08-27 15:59 insert vs. copy in pgAdmin Schlaffer, Sharon <Sharon.Schlaffer@nrl.navy.mil>
2020-08-27 16:07 ` Schlaffer, Sharon <Sharon.Schlaffer@nrl.navy.mil>
2020-08-28 11:32 ` Laurenz Albe <laurenz.albe@cybertec.at>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox