Re: Temp tables and copy

Поиск
Список
Период
Сортировка
От Nico King
Тема Re: Temp tables and copy
Дата
Msg-id 20030910015410.97911.qmail@web21309.mail.yahoo.com
обсуждение исходный текст
Ответ на Temp tables and copy  (Konstantin Goudkov <bcc@idftech.com>)
Список pgsql-hackers


Note: forwarded message attached.


Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
hi
it seems we are sharing the same problem at different levels.
here is my original porblem which I posted couple of days ago:
 
 
================================================================
Here is the problem I have some key tables that I need
to import some data into it.I can't go ahead and
write "insert into table value()"for over 40 different
tables and over 100s of rows and columns

The reason that I have to write a script to enter the
data into the tables is that what if I have to enter
1000 lines of data into 200 rows??
here is a piece of my script that works but not when I
enter lets' say a char instead of integer.
=========================================================
copy accounts from stdin using delimiters ',';
1,pass,mac,,,
2,pass2,mac2,ip,test
0,pass2,mac2,ip,test2
\.
=======================================================
P.S: also I have used the tab delimiter.

I have written a script to import some data into
my database tables, with the delimiter ','. Now my
question is sometime the data being sent to my tables
might not match the data type or be corrupted and I
recei ve an error message.
One: how could I prevent that?



Two: how can I proceed with importing the rest of the
data into the next record even though some are
corrupted,'cause I get intrupted as soon as there is
an error in inserting the data?


Konstantin Goudkov <bcc@idftech.com> wrote:

Hey guys, not sure if this is the right place to post.
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.
bcc@idftech.com


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly


Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Gavin Sherry
Дата:
Сообщение: Re: Can I use PostgreSQL to develop a self-organizing
Следующее
От: Philip Yarra
Дата:
Сообщение: Re: Unixware Patch (Was: Re: Beta2 Tag'd and Bundled ...)