Обсуждение: did not find any relation for existing table

Поиск
Список
Период
Сортировка

did not find any relation for existing table

От
"Sinead O Brien"
Дата:
Hello

I am receiving a "did not find any relation" error in pgsql for a table
which I know exists.  The outputs from the commands are as follows

cdx_post=# \d history.client;
Did not find any relation named "history.client".

cdx_post=# \dt history.clien*
             List of relations
Schema  |      Name       | Type  | Owner
---------+-----------------+-------+-------
history | client          | table | pgsql
history | client_activity | table | pgsql
history | client_flag     | table | pgsql

cdx_post=# \d history.clien*
                                   Table "history.client"
             Column             |              Type              |
Modifiers--------------------------------+--------------------------------+--------------------------
order_id                       | integer                        | not null
history_id                     | integer                        | not null
active                         | boolean                        |
client_id                      | character varying(32)          | not null

So, the table is there, but I can't access it using its name.  Any
suggestions would be greatly appreciated.

Thank you and Regards,
Sinead O Brien

_________________________________________________________________
Message offline contacts without any fire risk!
http://www.communicationevolved.com/en-ie/


Re: did not find any relation for existing table

От
Raymond O'Donnell
Дата:
On 06/05/2007 23:05, Sinead O Brien wrote:

> cdx_post=# \d history.client;
> Did not find any relation named "history.client".

Without actually trying it out myself, I wonder if the final semi-colon
on your command is causing problems - as far as I recall (I don't use
psql a whole lot), you need the semicolon for actual SQL but not for the
various "backslash" commands.

Ray.

---------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
---------------------------------------------------------------

Re: did not find any relation for existing table

От
"Sinead O Brien"
Дата:
Removing the semicolon gives the same output.

cdx_post=# \d history.client
Did not find any relation named "history.client".



>Without actually trying it out myself, I wonder if the final semi-colon on
>your command is causing problems - as far as I recall (I don't use psql a
>whole lot), you need the semicolon for actual SQL but not for the various
>"backslash" commands.

_________________________________________________________________
Make free PC-to-PC calls with no loss of life!
http://www.communicationevolved.com/en-ie/


Re: did not find any relation for existing table

От
Tom Lane
Дата:
"Sinead O Brien" <reapersoul@hotmail.com> writes:
> I am receiving a "did not find any relation" error in pgsql for a table
> which I know exists.

Hm, what PG version is this?  It might be that reindexing pg_class will
fix it, but it would be nice to try to determine what's wrong before
overwriting the evidence.

            regards, tom lane

Re: did not find any relation for existing table

От
"Sinead O Brien"
Дата:
>
>"Sinead O Brien" <reapersoul@hotmail.com> writes:
> > I am receiving a "did not find any relation" error in pgsql for a table
> > which I know exists.
>
>Hm, what PG version is this?  It might be that reindexing pg_class will
>fix it, but it would be nice to try to determine what's wrong before
>overwriting the evidence.
>
Thanks for the response, version is
psql (PostgreSQL) 8.0.3

_________________________________________________________________
Message offline contacts without any fire risk!
http://www.communicationevolved.com/en-ie/


Re: did not find any relation for existing table

От
Tom Lane
Дата:
"Sinead O Brien" <reapersoul@hotmail.com> writes:
>>> I am receiving a "did not find any relation" error in pgsql for a table
>>> which I know exists.
>>
>> Hm, what PG version is this?  It might be that reindexing pg_class will
>> fix it, but it would be nice to try to determine what's wrong before
>> overwriting the evidence.
>>
> Thanks for the response, version is
> psql (PostgreSQL) 8.0.3

8.0.3 is more than two years old --- you really ought to update to the
latest in that branch (8.0.13 currently), if not upgrade to 8.1.x or
8.2.x branches.  I do see a post-8.0.3 fix that might explain loss of
index entries, so trying a reindex is worth doing at this point.

            regards, tom lane

Re: did not find any relation for existing table

От
"Sinead O Brien"
Дата:
>
>8.0.3 is more than two years old --- you really ought to update to the
>latest in that branch (8.0.13 currently), if not upgrade to 8.1.x or
>8.2.x branches.  I do see a post-8.0.3 fix that might explain loss of
>index entries, so trying a reindex is worth doing at this point.

Thank you very much.  We'll try that out.

_________________________________________________________________
Message offline contacts without any fire risk!
http://www.communicationevolved.com/en-ie/


Re: did not find any relation for existing table

От
"Sinead O Brien"
Дата:
>
>Please check the output of the below query.
>
>select tablename,schemaname from pg_tables where schemaname='history';
>
>I assume that the table might have created under public schema. Please
>check
>the output of the above query and if the output consists of public in place
>of schemaname column then the object is residing in public schema not in
>history schema.
>


cdx_post-# select tablename,schemaname from pg_tables where
schemaname='history';
          tablename           | schemaname
------------------------------+------------
client                       | history

Thanks for the suggestion though (-:

_________________________________________________________________
Share folders without harming wildlife!
http://www.communicationevolved.com/en-ie/


Re: did not find any relation for existing table

От
"Prashant Ranjalkar"
Дата:
Hello,

Please check the output of the below query.

select tablename,schemaname from pg_tables where schemaname='history';

I assume that the table might have created under public schema. Please check the output of the above query and if the output consists of public in place of schemaname column then the object is residing in public schema not in history schema.

Please try this.

Regards,
Prashant Ranjalkar
EnterpriseDB

On 5/7/07, Sinead O Brien <reapersoul@hotmail.com > wrote:

>
>"Sinead O Brien" < reapersoul@hotmail.com> writes:
> > I am receiving a "did not find any relation" error in pgsql for a table
> > which I know exists.
>
>Hm, what PG version is this?  It might be that reindexing pg_class will
>fix it, but it would be nice to try to determine what's wrong before
>overwriting the evidence.
>
Thanks for the response, version is
psql (PostgreSQL) 8.0.3

_________________________________________________________________
Message offline contacts without any fire risk!
http://www.communicationevolved.com/en-ie/


---------------------------(end of broadcast)---------------------------
TIP 1: 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