psycopg2.ProgrammingError: relation "foo" does not exist when doing "select * from foo"

bear <[email protected]>
Newsgroups gmane.comp.python.db.psycopg.devel
Message-ID <[email protected]>
Really odd error that is causing me much grief tonight :(

I added a new table to my postgresql database using:

DROP TABLE foo CASCADE;

CREATE TABLE foo (
    id integer NOT NULL
);

ALTER TABLE public.foo OWNER TO bear;

ALTER TABLE ONLY foo
    ADD CONSTRAINT foo_pkey PRIMARY KEY (id);

and I am consistenly getting the error for any select made against table foo.

I have isolated the call so it happens first in my code and even ran
other selects to make sure the connection was ok and it wasn't
something else.

I've also tried to quote the table name using these methods:

select * from public.foo
select * from "foo"
select * from "public"."foo"

and all of them generate the relation error.

Any pointers to how I can fix this - needless to say it has be tearing
my hair out.

thanks,

-- 
---
Bear
http://code-bear.com

PGP Fingerprint = 9996 719F 973D B11B E111  D770 9331 E822 40B3 CD29
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.