1

Windows, pgAdmin, PostgreSQL server hosted on Amazon AWS. Logged in on PgAdmin 4 as admin/owner, accessing an admin created database called 'client'.

I have two identical post-gis enabled tables, one tabled is named 'testboundary' and stored in the public schema, the other is named 'testboundaryNW' and is stored in a new schema called 'NW'.

When I right click the table in public and query this:

SELECT *
FROM testboundary

I get the contents of the table returned as expected.

When I right click the table in the 'NW' schema and query this:

SELECT *
FROM testboundaryNW

I get an error:

ERROR:  relation "testboundarynw" does not exist
LINE 2: FROM testboundaryNW
             ^
SQL state: 42P01
Character: 15

Why is this? Usage/access rights are the same on public and NW schemas.

closed as off-topic by mustaccio, Marcello Miorelli, Mike Walsh, kevinsky, LowlyDBA Oct 9 at 14:26

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Too localized - this could be because your code has a typo, basic error, or is not relevant to most of our audience. Consider revising your question so that it appeals to a broader audience. As it stands, the question is unlikely to help other users (regarding typo questions, see this meta question for background)." – mustaccio, Marcello Miorelli, Mike Walsh, kevinsky, LowlyDBA
If this question can be reworded to fit the rules in the help center, please edit the question.

2

Turns out, when querying anything other than the public schema, you need to change the syntax of the query from:

SELECT *
FROM testboundaryNW

to

SELECT * FROM "NW"."testbonudaryNW"

if I renamed the table to testboundarynw (no caps on NW) I don't need the "" around it.

  • 3
    Or you can adjust the search_path – a_horse_with_no_name Nov 5 '18 at 14:08
  • @a_horse_with_no_name That is worth an answer on its own in order to salvage this Q&A as interesting for the community. OP can then decide which answer to accept. – hot2use Oct 9 at 11:04

Not the answer you're looking for? Browse other questions tagged or ask your own question.