Re: [HACKERS] Problems doing a copy to a table

From: jwieck(at)debis(dot)com (Jan Wieck)
To: chris_d_williams(at)itd(dot)sterling(dot)com
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Problems doing a copy to a table
Date: 1999-02-01 20:23:26
Message-ID: m107PsU-000EBPC@orion.SAPserv.Hamburg.dsh.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Chris Williams wrote:

>
> I am creating a text file to do file dumps into postgres using the copy command. The copy command
> executes fine but when I do a count on the table, I get zero records. But when I do a vacuum
> command on that table, here is what is says
>
> sdbm=> vacuum verbose D_TERM_APPROACH;
> NOTICE: --Relation d_term_approach--
> NOTICE: Pages 490: Changed 0, Reapped 490, Empty 0, New 0; Tup 0: Vac 11530, Crash 11530, UnUsed 0,
> MinLen 0, MaxLen 0; Re-using: Free/Avail. Space 3964040/0; EndEmpty/Avail. Pages 490/0. Elapsed 0/1
> sec.
> NOTICE: Rel d_term_approach: Pages: 490 --> 0.
>
> I know the 11530 is the correct number of tuples that should have been added to the table. Any
> ideas on what may be happening or how I can debug this problem. I am using version 6.4 on Solaris
> 2.5.1.

The notice about 'Crash 11530' tells that the copy didn't
execute as fine as you thought. Don't know what causes the
crash though as long as I can't see some part of what you're
trying to copy in.

But as a matter of fact, the backend copying in must do
something very bad at the end of it's COPY. Thus the
transaction doesn't commit correctly and vacuum just whipes
out the data which came from a crashed transaction. Whithout
a correct committed transaction, your whole approach is a big
noop.

Please try to reproduce the error with a smaller amount of
(maybe anonymized data) and give a reproducable example of
what you're in detail do (table schema, test-data and exact
copy command).

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#======================================== jwieck(at)debis(dot)com (Jan Wieck) #

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Goran Thyni 1999-02-01 20:29:55 New patch (was: tough bug)
Previous Message Bruce Momjian 1999-02-01 20:08:49 Re: [GENERAL] big bad join problems