Re: continuous data from stdin

From: Neil Conway <neilc(at)samurai(dot)com>
To: Jeff Boes <jboes(at)nexcerpt(dot)com>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: continuous data from stdin
Date: 2003-02-21 07:00:06
Message-ID: 1045810806.583.469.camel@tokyo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 2003-02-18 at 13:34, Jeff Boes wrote:
> I think you're going to have to write a program (Perl using DBI would be
> my choice) to use this output as input, and do INSERT statements as each
> record is received. (The COPY command in SQL won't do the trick, if
> that's what you're thinking of.)

Actually, COPY should work fine, AFAICS. Write a client app to open a
connection to PostgreSQL, execute "COPY xxx FROM stdin;", and then push
lines of COPY input over the wire to PostgreSQL using PQputline(), and
end the COPY using PQendcopy().

That assumes you're using libpq -- other interfaces should provide a
similar way to do the same thing.

Cheers,

Neil
--
Neil Conway <neilc(at)samurai(dot)com> || PGP Key ID: DB3C29FC

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Nigel J. Andrews 2003-02-21 08:11:14 Re: Backend often crashing
Previous Message Dennis Gearon 2003-02-21 06:57:48 Re: Bit string storage space?