Re: how to use COPY within plperl

From: "Goutam Paruchuri" <gparuchuri(at)oneil(dot)com>
To: "Marek Lewczuk" <newsy(at)lewczuk(dot)com>, "Lista dyskusyjna pgsql-general" <pgsql-general(at)postgresql(dot)org>, "Lista dyskusyjna pgsql-sql" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: how to use COPY within plperl
Date: 2004-11-08 19:04:00
Message-ID: B2C547DF42419645804F05B54290755ADC7C9A@DAYTONEX.oneilinc.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

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(at)postgresql(dot)org
> [mailto:pgsql-general-owner(at)postgresql(dot)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.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Marek Lewczuk 2004-11-08 19:14:22 Re: how to use COPY within plperl
Previous Message Goutam Paruchuri 2004-11-08 18:54:22 Re: Mass Import/Generate PKs

Browse pgsql-sql by date

  From Date Subject
Next Message Marek Lewczuk 2004-11-08 19:14:22 Re: how to use COPY within plperl
Previous Message Steven Klassen 2004-11-08 15:57:14 Re: Hi