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

From Peter Eisentraut
Subject Re: [GENERAL] Postgresql's "copy tablefrom STDIN" and DBD-Pg.
Date
Msg-id Pine.LNX.4.20.9911292226160.658-100000@localhost.localdomain
Whole thread Raw
In response to Postgresql's "copy tablefrom STDIN" and DBD-Pg.  (Rodney McDuff <ccmcduff@its.uq.edu.au>)
List 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@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden



pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [GENERAL] memory
Next
From: "John Henderson"
Date:
Subject: memory