Re: Copy command (bug??) - Mailing list pgsql-novice

From Jeff Eckermann
Subject Re: Copy command (bug??)
Date
Msg-id 20030516200416.76239.qmail@web20808.mail.yahoo.com
Whole thread Raw
In response to Copy command (bug??)  (roboccc@t-online.de (Bogdan Chytrek))
List pgsql-novice
--- Bogdan Chytrek <roboccc@t-online.de> wrote:
> hi folks,
>
> as i'm new, i'm not sure if this forum is the right
> one. i found a bug,
> maybe in postgresql 7.2.1 or in my brain (you tell
> me):
>
> i want to copy a table from one datbase (DB1) to
> another (DB2).
> So i start psql with DB1 and execute:
>
> \copy phfields to phfields.bak using delimiters '"'
> \q
>
> then i start psql again with DB2 and execute:
>
> \copy fields from phfields.bak using delimiters '"'
>
> ok, i also changed the name of the table. but the
> problem is: i receive the
> following message:
>
> ERROR: copy: line 1, pg_atoi: error in
> "VARCHAR(16)": can't parse
> "VARCHAR(16)"
>
> psql just produced the file phfields.bak. Why is it
> a problem to read it? Is
> just some seconds later and i did not touch the
> .bak-file manually.
>
> thanks in advance
> --------------------------- the create-table command
> --------------
> CREATE TABLE  fields (
>  pflid SERIAL PRIMARY KEY,
>  pfltbl VARCHAR(16),
>  pflindx INTEGER,
>  pflname VARCHAR(16),
>  pflaname VARCHAR(32),
>  pfldlevel INTEGER,
>  pflmlevel INTEGER,
>  pfldefstr INTEGER,
>  pflcomment INTEGER,
>  pflsorti INTEGER,
>  pflquickv INTEGER,
>  pflselv INTEGER,
>  pflinput INTEGER,
>  pflupdate INTEGER,
>  pflconv INTEGER,
>  pflres15 INTEGER,
>  pflres16 INTEGER
>  );
> ----------------- some records of the .bak-file:
> ---------------
> 2"phfields"1"pfltbl"Tabelle"12"14"VARCHAR(16)"Name
> der Tabelle, in der sich
> die Variable befindet"\N"\N"\N"\N"\N"\N"\N"\N

You must have changed the table definition.  There is
no way that you could store strings (VARCHAR(16), for
example) in an integer column, which is what COPY is
complaining about.

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

pgsql-novice by date:

Previous
From: Jeff Eckermann
Date:
Subject: Re: MSAccess-like Last() with sorting before grouping
Next
From: Jeff Eckermann
Date:
Subject: Re: Insert on create table