Received: from oscar.eng.cv.net (oscar.eng.cv.net [167.206.9.141]) by postgresql.org (Postfix) with ESMTP id A3D3A475832 for ; Fri, 26 Jul 2002 14:53:23 -0400 (EDT) Received: from oscar.eng.cv.net (localhost [127.0.0.1]) by oscar.eng.cv.net (8.12.5/8.12.5) with ESMTP id g6QIk1X0021020 for ; Fri, 26 Jul 2002 14:46:01 -0400 (EDT) (envelope-from marc@oscar.eng.cv.net) Received: (from marc@localhost) by oscar.eng.cv.net (8.12.5/8.12.5/Submit) id g6QIk0Zl021019 for pgsql-sql@postgresql.org; Fri, 26 Jul 2002 14:46:00 -0400 (EDT) Date: Fri, 26 Jul 2002 14:46:00 -0400 From: Marc Spitzer To: pgsql-sql Subject: Re: 1 milion data insertion Message-ID: <20020726144600.C16887@oscar.eng.cv.net> Mail-Followup-To: pgsql-sql References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from ElielsonF@prodam.sp.gov.br on Fri, Jul 26, 2002 at 03:34:12PM -0300 X-Archive-Number: 200207/421 X-Sequence-Number: 8799 On Fri, Jul 26, 2002 at 03:34:12PM -0300, Elielson Fontanezi wrote: > Hi fellows! > > I have tried to insert 1.000.000 of record to the following table; > > -------------------------------------------------- > zakal=# \d teste; > codigo | bigint | not null > nome | character varying(100) | > -------------------------------------------------- > > and I got these errors: > > -------------------------------------------------- > zakal$ psql -c "copy teste from 'teste.dat' using delimeters '|'" > ERROR: parser: parse error at or near "delimeters" > ERROR: parser: parse error at or near "delimeters" > zakal$ psql -c "copy teste from 'teste.dat' using delimiters '|'" > ERROR: COPY command, running in backend with effective uid 504, could not > open > file 'teste.dat' for reading. Errno = No such file or directory (2). > ERROR: COPY command, running in backend with effective uid 504, could not > open > file 'teste.dat' for reading. Errno = No such file or directory (2). > zakal$ pwd > /home/zakal/tmp > zakal$ psql -c "copy teste from '`pwd`/teste.dat' using delimiters '|'" > DEBUG: copy: line 27536, XLogWrite: new log file created - consider > increasing > WAL_FILES > DEBUG: copy: line 93146, XLogWrite: new log file created - consider > increasing > WAL_FILES > DEBUG: recycled transaction log file 0000000000000000 > > > ERROR: copy: line 164723, Bad int8 external representation "16722" > ERROR: copy: line 164723, Bad int8 external representation "16722" > zakal$ > zakal$ > zakal$ DEBUG: recycled transaction log file 0000000000000001 > ---------------------------------------------------------------------- > > the log has overflowed. > > Ok, this was a test. I'd like to know what would be happen. > But, from you, great PostGres DBA's, what is the best way to > insert a large number of data? > Is there a way to turn off the log? > Is there a way to commit each 100 records? > > regards, in relativly small chuncks, do 100 10,000 record transactions and you should be fine. marc > > .............................................. > A Question... > Since before your sun burned hot in space and before your race was born, I > have awaited a question. > > Elielson Fontanezi > DBA Technical Support - PRODAM > +55 11 5080 9493 > > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org