Received: from sand6.global.net.uk (sand6.global.net.uk [195.147.246.105]) by hub.org (8.9.3/8.9.3) with ESMTP id XAA80977 for ; Sat, 20 May 2000 23:25:34 -0400 (EDT) (envelope-from stuart@stubbynet.org.uk) Received: from p3cs05a02.client.global.net.uk ([195.147.149.61] helo=hostname ident=root) by sand6.global.net.uk with esmtp (Exim 3.03 #1) id 12tMOm-0001Xl-00 for pgsql-sql@postgresql.org; Sun, 21 May 2000 04:27:29 +0100 Received: (qmail 10398 invoked from network); 20 May 2000 21:54:16 -0000 Received: from softdnserror (HELO ewood) (10.0.0.2) by softdnserror with SMTP; 20 May 2000 21:54:16 -0000 Message-ID: <004101bfc2a5$e6a18280$0200000a@home.stubbynet.org.uk> From: "Stuart Grimshaw" To: "Postgres-SQL" Subject: Adding many rows to a table. Date: Sat, 20 May 2000 22:53:57 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Archive-Number: 200005/90 I was recently doing some testing into which of two methods of searching a large block of text was faster. One of the ways I came up with was to identify keywords in an article and then have a table to cross reference these keywords back to the article they appear in. article|keyword --------------- 520 |cheese 520 |bread 521 |pickle 522 |spam you get the picture. I wrote a perl program to extract these keywords, with the idea of inserting them into a database. The first way I tried was to have lots on "insert into"'s in 1 string, then execute that string. Worked OK until the string contained too many keywords and the query was too large (this was under 6.5.3) The docs suggest using "copy to" for inserting lots of data. I created a string : COPY TO keywords FROM STDIN USING DELIMITERS ','; 520,cheese 520,bread 521,pickle 522,spam \. and then executed it, and got the following error ERROR: parser: parse error at or near "520" So my question is, after all that, is that the right way to construct my string (regardless of language, Perl C/C++ etc) By the way, I've ditched this idea for now, and just use a common or garden index on the feild I want to search for the keywords. I just want to be able to actually do this, you never know when it might come in handy. --------------------------------------- Stuart Grimshaw | Schoolsnet LTD | Special www.schoolsnet.com | Projects | Developer stuart@stubbynet.org.uk | ---------------------------------------