Re: Problems on "copy" statement - Mailing list pgsql-novice

From Keith Worthington
Subject Re: Problems on "copy" statement
Date
Msg-id 20050413163807.M61946@narrowpathinc.com
Whole thread Raw
In response to Re: Problems on "copy" statement  (Leung Wing Lap Ellery <lap01@netvigator.com>)
Responses Re: Problems on "copy" statement  (Michael Fuhr <mike@fuhr.org>)
List pgsql-novice
> Michael Fuhr wrote:
>
> >On Wed, Apr 13, 2005 at 10:38:02AM -0400, Keith Worthington wrote:
> >
> >
> >>On Wed, 13 Apr 2005 22:29:05 +0800, Leung Wing Lap Ellery wrote
> >>
> >>
> >>>copy hsi from 'c:\java\hsi.txt'
> >>>
> >>>it generated error:
> >>>
> >>>ERROR:  relation "hsi" does not exist
> >>>copy hsi from 'c:\java\hsi.txt'
> >>>
> >>>
> >>It seems to me that it cannot find the table.  Try schema qualifying the
> >>tablename.
> >>
> >>
> >
> >Another possibility is that the table name is mixed-case -- if so,
> >then it'll have to be quoted.
> >
>
>http://www.postgresql.org/docs/8.0/interactive/sql-syntax.html#SQL-SYNTAX-IDENTIFIERS
> >
> >What's the result of the following query?
> >
> >SELECT schemaname, tablename
> >FROM pg_tables
> >WHERE tablename ILIKE '%hsi%';
> >
On Thu, 14 Apr 2005 00:24:42 +0800, Leung Wing Lap Ellery wrote
> Thanks for your reply.
>
> Run the sql:
>
> SELECT schemaname, tablename
> FROM pg_tables
> WHERE tablename ILIKE '%hsi%';
>
> get:
>
> schemaname     tablename
>
> public
>
>
>
> HSI
>
> when run the sql:
>
> copy public.HSI from 'c:\java\hsi.txt'
>
> error:
>
> ERROR:  relation "public.hsi" does not exist
>
> er...did I do something silly? What is the problem?
>
> Thanks in advance.
>
> Ellery Leung

Well, your table is in the public schema so obviously the schema qualification
is not required.

I wonder if there are some hidden characters or perhaps whitespace in the
table name.  It seems odd that the output of Michael's suggestion is split
across several lines.  I am sorry but you will have to wait for someone other
than me to tell you how to figure that out.

How was the table created?  Can you show us the commands?  That might help.

Kind Regards,
Keith

pgsql-novice by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: Problems on "copy" statement
Next
From: Michael Fuhr
Date:
Subject: Re: Problems on "copy" statement