Re: [INTERFACES] DBI and 'COPY' ... possible?

From: Goran Thyni <goran(at)kirra(dot)net>
To: The Hermit Hacker <scrappy(at)hub(dot)org>
Cc: pgsql-interfaces(at)postgreSQL(dot)org
Subject: Re: [INTERFACES] DBI and 'COPY' ... possible?
Date: 1999-11-29 19:44:59
Message-ID: 3842D7BB.8008988@kirra.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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!

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message The Hermit Hacker 1999-11-29 21:05:55 Re: [INTERFACES] libpq + multiple connections ...
Previous Message Lamar Owen 1999-11-29 16:34:24 Re: [INTERFACES] pgaccess on win95 connection