Re: [GENERAL] Postgresql's "copy tablefrom STDIN" and DBD-Pg.

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Rodney McDuff <ccmcduff(at)its(dot)uq(dot)edu(dot)au>
Cc: "pgsql-general(at)hub(dot)org" <pgsql-general(at)hub(dot)org>
Subject: Re: [GENERAL] Postgresql's "copy tablefrom STDIN" and DBD-Pg.
Date: 1999-11-30 00:03:11
Message-ID: Pine.LNX.4.20.9911292226160.658-100000@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Since COPY is PostgreSQL specific and DBD/DBI is supposed to be generic, I
don't think there's an easy way and you wouldn't be doing yourselves any
favours anyway.

If you insist on using COPY then you can use our native "Pg" Perl module,
which has functions equivalent to libpq's getline() and putline(), which
are necessary to handle COPY input and output. In the psql source code
(src/bin/psql/*.c) there are two functions called handleCopy{In|Out} that
handle this correctly, but I suspect in Perl it might be a lot easier
since you don't have to worry about memory allocation.

Good luck.

-Peter

On 1999-11-29, Rodney McDuff mentioned:

> Hi
> Is there a way of using postgresql's "copy table from STDIN"
> with DBD-Pg.
>
>

--
Peter Eisentraut Sernanders väg 10:115
peter_e(at)gmx(dot)net 75262 Uppsala
http://yi.org/peter-e/ Sweden

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Hiroshi Inoue 1999-11-30 00:34:03 RE: [HACKERS] Re: [GENERAL] drop/rename table and transactions
Previous Message John Henderson 1999-11-30 00:00:46 memory