dbTalk Databases Forums  

Re: how to use COPY within plperl

comp.databases.postgresql.general comp.databases.postgresql.general


Discuss Re: how to use COPY within plperl in the comp.databases.postgresql.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Goutam Paruchuri
 
Posts: n/a

Default Re: how to use COPY within plperl - 11-08-2004 , 01:04 PM






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



Quote:
-----Original Message-----
From: pgsql-general-owner (AT) postgresql (DOT) org
[mailtogsql-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.


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.