Re: [INTERFACES] DBI and 'COPY' ... possible? - Mailing list pgsql-interfaces

From Goran Thyni
Subject Re: [INTERFACES] DBI and 'COPY' ... possible?
Date
Msg-id 3842D7BB.8008988@kirra.net
Whole thread Raw
In response to DBI and 'COPY' ... possible?  (The Hermit Hacker <scrappy@hub.org>)
List 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!

************




pgsql-interfaces by date:

Previous
From: Lamar Owen
Date:
Subject: Re: [INTERFACES] pgaccess on win95 connection
Next
From: The Hermit Hacker
Date:
Subject: Re: [INTERFACES] libpq + multiple connections ...