Lokomotywa
Lokomotywa

Reputation: 2844

postgres - select * from existing table - psql says table does not exist

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?

Upvotes: 24

Views: 64820

Answers (3)

ALL ROUNDERS
ALL ROUNDERS

Reputation: 111

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

Upvotes: 9

Usman
Usman

Reputation: 575

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)

Upvotes: 3

Walker Farrow
Walker Farrow

Reputation: 3875

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.

Upvotes: 58

Related Questions