471,108 Members | 1,279 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,108 software developers and data experts.

Temp tables and copy

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.

For example
create temp table words(aa varchar(254));
copy words from stdin;
some stuff
more stuff
corrupt line\tline\tline
more\tstuff
and yet more stuff
\.

(replace ''\t'' with the real tabs to break the synchronization)

after that,

select * from words;
ERROR: Relation "words" does not exist

Running:
Welcome to psql 7.3.4, the PostgreSQL interactive terminal. on FreeBSD dev1.idftech.com 4.6-RELEASE FreeBSD 4.6-RELEASE #2: Sun Jun 8

04:57:54 EDT 2003
Konstantin Goudkov
IDF Technologies, LLC.
bc*@idftech.com
Nov 11 '05 #1
3 4470
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

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 11 '05 #2
> A message like this?
lost synchronization with server, resetting connection


Yeah, like that.
I get pissed way too often when people miss simplest things and bug me with
stupid questions, and now it's me.
Sorry guys.
Nov 11 '05 #3
> A message like this?
lost synchronization with server, resetting connection


Yeah, like that.
I get pissed way too often when people miss simplest things and bug me with
stupid questions, and now it's me.
Sorry guys.
Nov 11 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Rebecca Lovelace | last post: by
8 posts views Thread by Ootyguy | last post: by
1 post views Thread by Konstantin Goudkov | last post: by
21 posts views Thread by Boris Popov | last post: by
17 posts views Thread by Jon Ole Hedne | last post: by
9 posts views Thread by BillCo | last post: by
1 post views Thread by serge | last post: by
4 posts views Thread by robert d via AccessMonster.com | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.