Re: Temp tables and copy - Mailing list pgsql-general

From Richard Huxton
Subject Re: Temp tables and copy
Date
Msg-id 200309100920.51597.dev@archonet.com
Whole thread Raw
In response to Temp tables and copy  ("Konstantin Goudkov" <bcc-ng@idftech.com>)
List pgsql-general
On Wednesday 10 September 2003 02:22, Konstantin Goudkov wrote:
> I posted it to the pgsql-hackers list, but I did not seem to get through.
>
> Not even sure if this is a bug or a feature :)
>
> When I create a temp table and then try to copy some data into the
> table, if the data is corrupt and the synchronization is lost - the
> table also seems to get lost.

A message like this?
  lost synchronization with server, resetting connection

Temporary tables get removed when the connection is broken. In any case, all
or nothing of the COPY ... FROM should work, so you can't check what was the
first item that failed.

If you use the \i from psql's command line you can get line numbers for the
file, or "psql -f filename" will do the same.

PS - I've found that writing a small Perl script to process import files and
fix bugs saves me time. It takes longer the first time, but if I need to
re-import (and it seems I always do) then I can just run the perl over my
source data.

--
  Richard Huxton
  Archonet Ltd

pgsql-general by date:

Previous
From: Thierry Missimilly
Date:
Subject: Postgres 7.4Beta2 Thread-safe
Next
From: Richard Huxton
Date:
Subject: Re: SUMMARY mysql -> psql