Re: Copy command (bug??)

From: Jeff Eckermann <jeff_eckermann(at)yahoo(dot)com>
To: bogdan(at)chytrek(dot)de, pgsql-novice(at)postgresql(dot)org
Subject: Re: Copy command (bug??)
Date: 2003-05-16 20:04:16
Message-ID: 20030516200416.76239.qmail@web20808.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

--- Bogdan Chytrek <roboccc(at)t-online(dot)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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Jeff Eckermann 2003-05-16 20:12:01 Re: Insert on create table
Previous Message Jeff Eckermann 2003-05-16 19:59:29 Re: MSAccess-like Last() with sorting before grouping