Re: continuous data from stdin - Mailing list pgsql-general

From Neil Conway
Subject Re: continuous data from stdin
Date
Msg-id 1045810806.583.469.camel@tokyo
Whole thread Raw
In response to Re: continuous data from stdin  (Jeff Boes <jboes@nexcerpt.com>)
List 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@samurai.com> || PGP Key ID: DB3C29FC




pgsql-general by date:

Previous
From: Dennis Gearon
Date:
Subject: Re: Bit string storage space?
Next
From: Tony Grant
Date:
Subject: Re: Backend often crashing