pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
DBI and 'COPY' ... possible?
2+ messages / 2 participants
[nested] [flat]

* DBI and 'COPY' ... possible?
@ 1999-11-25 04:56  The Hermit Hacker <scrappy@hub.org>
  0 siblings, 1 reply; 2+ messages in thread

From: The Hermit Hacker @ 1999-11-25 04:56 UTC (permalink / raw)
  To: pgsql-interfaces


I've just checked the perldoc's on DBI and DBD::Pg, and can't see any way
of doing this in perl that "jumps out at me"...has anyone gotten this to
work, and how? 

Thanks...

Marc G. Fournier                   ICQ#7615664               IRC Nick: Scrappy
Systems Administrator @ hub.org 
primary: scrappy@hub.org           secondary: scrappy@{freebsd|postgresql}.org 




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

* Re: [INTERFACES] DBI and 'COPY' ... possible?
@ 1999-11-29 19:44  Goran Thyni <goran@kirra.net>
  parent: The Hermit Hacker <scrappy@hub.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Goran Thyni @ 1999-11-29 19:44 UTC (permalink / raw)
  To: The Hermit Hacker <scrappy@hub.org>; +Cc: pgsql-interfaces

The Hermit Hacker wrote:
> 
> I've just checked the perldoc's on DBI and DBD::Pg, and can't see any way
> of doing this in perl that "jumps out at me"...has anyone gotten this to
> work, and how?

Marc,

No DBI-way I konow of,
but perl is the greatest glue language.

I did it like this, exemple below:

    open(FIL, "| psql $databas");
    print FIL "COPY x_kw FROM STDIN USING DELIMITERS '|';\n";
    foreach (sort keys %kw)
      {
        my $id = $kw{$_};
        /^(.+)\+(\w)$/;
        my ($kw,$kat) = ($1,$2);
        print FIL "$id|$kw|$kat\n";
      }
    close FIL;


best regards,
Göran Thyni

--------------------
On quiet nights you can hear Windows NT reboot!



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


end of thread, other threads:[~1999-11-29 19:44 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-11-25 04:56 DBI and 'COPY' ... possible? The Hermit Hacker <scrappy@hub.org>
1999-11-29 19:44 ` Goran Thyni <goran@kirra.net>

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