X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A154C3A4069; Mon, 8 Nov 2004 19:04:13 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 86895-08; Mon, 8 Nov 2004 19:04:09 +0000 (GMT) Received: from meridius.oneil.com (meridius.oneil.com [66.194.184.36]) by svr1.postgresql.org (Postfix) with ESMTP id AE8403A4066; Mon, 8 Nov 2004 19:04:10 +0000 (GMT) Received: from [192.168.1.20] ([192.168.1.20]:58894 "EHLO daytonnt20.oneilinc.net" ident: "NO-IDENT-SERVICE[2]") by meridius.oneil.com with ESMTP id convert rfc822-to-8bit; Mon, 8 Nov 2004 14:04:10 -0500 Received: from DAYTONEX.oneilinc.net (unverified) by daytonnt20.oneilinc.net (Content Technologies SMTPRS 4.3.14) with ESMTP id ; Mon, 8 Nov 2004 14:04:00 -0500 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT Subject: Re: how to use COPY within plperl X-MIMEOLE: Produced By Microsoft Exchange V6.5.7226.0 Date: Mon, 8 Nov 2004 14:04:00 -0500 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [GENERAL] how to use COPY within plperl Thread-Index: AcTFcoYAceLNuhh2S6m/ST6OlwdeLAAUw6mw From: "Goutam Paruchuri" To: "Marek Lewczuk" , "Lista dyskusyjna pgsql-general" , "Lista dyskusyjna pgsql-sql" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200411/333 X-Sequence-Number: 68413 Why can you not use simple insert statements (sql insert). Copy is meant to transfer large amount of data from text files to databases and vice versa. - Goutam > -----Original Message----- > From: pgsql-general-owner@postgresql.org > [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Marek Lewczuk > Sent: Monday, November 08, 2004 3:59 AM > To: Lista dyskusyjna pgsql-general; Lista dyskusyjna pgsql-sql > Subject: [GENERAL] how to use COPY within plperl > > > Hello, > I need to use COPY (instead of INSERT) within plperl > function. I know that COPY will work if data will be taken > from file - however I need to use STDIN. I tried this: > spi_exec_query("COPY sometable (field1, field2) FROM > stdin;"."\n"."sometext"."\t"."sometext"."\n"."\.") > > But it didn't work. Thanks in advance. > > > > ---------------------------(end of > broadcast)--------------------------- > TIP 9: the planner will ignore your desire to choose an index > scan if your > joining column's datatypes do not match > Confidentiality Notice The information contained in this e-mail is confidential and intended for use only by the person(s) or organization listed in the address. If you have received this communication in error, please contact the sender at O'Neil & Associates, Inc., immediately. Any copying, dissemination, or distribution of this communication, other than by the intended recipient, is strictly prohibited.