X-Original-To: pgsql-general@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id F3BB6476D11 for ; Fri, 16 May 2003 16:27:46 -0400 (EDT) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with ESMTP id 53413-08 for ; Fri, 16 May 2003 16:27:45 -0400 (EDT) Received: from mail.gmx.net (mail.gmx.net [213.165.65.60]) by postgresql.org (Postfix) with SMTP id DBECE476D01 for ; Fri, 16 May 2003 16:27:44 -0400 (EDT) Received: (qmail 14917 invoked by uid 65534); 16 May 2003 20:27:45 -0000 Received: from pD9E6D095.dip.t-dialin.net (EHLO gmx.de) (217.230.208.149) by mail.gmx.net (mp011-rz3) with SMTP; 16 May 2003 22:27:45 +0200 Message-ID: <3EC549BE.5040403@gmx.de> Date: Fri, 16 May 2003 22:27:42 +0200 From: "alex b." User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Postgresql General Subject: Re: realtime data inserts References: <6754.1052582402@sss.pgh.pa.us> <1052591490.26574.161.camel@haggis> <10704.1052621185@sss.pgh.pa.us> <1052672090.995.13.camel@haggis> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/627 X-Sequence-Number: 42282 Doug McNaught wrote: > Ron Johnson writes: > > >>On Sat, 2003-05-10 at 21:46, Tom Lane wrote: >> >>>Ron Johnson writes: >>> >>>>On Sat, 2003-05-10 at 11:00, Tom Lane wrote: >>>> >>>>>Have you thought about using COPY? >>> >>>>Generate a temporary file, and then system("COPY /tmp/foobar ...") ? >>> >>>No, copy from stdin. No need for a temp file. >> >>But wouldn't that only work if the input stream is acceptable to >>COPY ? > > > Yes, but you could always pipe it through a script or C program to > make it so... lets say I have an about 1kb/s continuus datastream comming in for many hours and I'd like to store this data in my db using COPY table FROM stdin. At what time should I COMMIT or close the stream to feed the database and COPY FROM again?