14

I managed to create a table in a schema FOO.

Whenever I then try and do anything, like even a basic select, I just get:

ERROR: schema "FOO" does not exist
SQL state: 3F000
Character: 15

I am running the select in the same edit window as I created (using pgAdmin4). I get the same error when I try and create a view call FOO.Info. Yet when I try and create a new table in FOO it works.

What's going on? I am using the same syntax to refer to the table in the select as the create.

# worked fine
CREATE TABLE "FOO"."Events"
(
...

# all these have the error
select * from "FOO"."Events";
select * from FOO.Events;
select * from Foo.Events;
postgres=# \dn
  List of schemas
  Name  |  Owner   
--------+----------
 foo    | postgres
 public | postgres
(2 rows)
a_horse_with_no_name
  • 497,550
  • 91
  • 775
  • 843
aaa90210
  • 10,085
  • 13
  • 48
  • 86

1 Answers1

5

I believe you created it as

create schema FOO;

which creates schema "foo", not "FOO"

And then you reference it as

select * from "FOO".table_name

so it is not found

Vao Tsun
  • 42,665
  • 8
  • 85
  • 115
  • 1
    no ive tried all case combination, and as I said, when I refer to the schema in a "create table" statement in exactly the same way, it works. – aaa90210 May 19 '17 at 07:18
  • 1
    ah. cool. so please put working and not working statements with error to the original post?.. – Vao Tsun May 19 '17 at 07:20