24

Fresh postgres installation, db 'test', table 'Graeber' created from another program.

I want to see the content of table 'Graeber'. When I connect to the database and try to select the content of 'Graeber', the application tells me : ERROR: relation "graeber" does not exist.

See screenshot:

enter image description here

What is wrong here?

2
  • 9
    Yes because you have to use " for capitaletter: SELECT * FROM "Graeber" Commented Jan 30, 2015 at 16:37
  • postgresql.org/docs/current/static/… Commented Jan 30, 2015 at 16:40

3 Answers 3

60

Try adding the schema as in:

select *
from public.Graeber

If that doesn't work, then it is because you have a capital letter so try:

select *
from public."Graeber"

Hope this helps.

Sign up to request clarification or add additional context in comments.

5 Comments

thanks, i had a similar problem. the select * from public."Graeber" worked for me
seems that capital letters for table names need to be surrounded with quotes... I didn't need the public. part. Thanks for your help.
Thanks i had this issue with Hive tables all in CAPS. I couldn't figure out why Postgres should would not find them.
If you want one specific column with case sensitive table names and case sensitive columns: SELECT "Graeber"."Name" FROM public."Graeber"
select * from "Graeber" will also work. No need to add public.
9

When using the psql console in cmd, sometimes you may forget to add ';' at the end of select statement

Example -1: select * from user #does not give any result back

select * from user; #this works with ';' at the end

Don't take me wrong I faced this issue in Postgresql version 13

Comments

3

See This Example.

queuerecords=# create table employee(id int,name varchar(100));
        CREATE TABLE


queuerecords=# insert into employee values(1,'UsmanYaqoob');
        INSERT 0 1


queuerecords=# select * from employee;
    id |    name
    ----+-------------
    1 | UsmanYaqoob
    (1 row)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.