Re: BUG #16203: So difficult to set an use postgres

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Reyna Melara <remabarca(at)gmail(dot)com>
Cc: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #16203: So difficult to set an use postgres
Date: 2020-01-25 01:31:27
Message-ID: 25717.1579915887@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Reyna Melara <remabarca(at)gmail(dot)com> writes:
> I understand I need to be more specific, I have

> Admissions=# \dt
> Listado de relaciones
> Esquema | Nombre | Tipo | Dueño
> ---------+---------+-------+----------
> public | apply | tabla | postgres
> public | college | tabla | postgres
> public | student | tabla | postgres
> (3 filas)

> SELECT sID, sName, GPA FROM Student WHERE GPA > 3.6;
> ERROR: no existe la relación «student»
> LÍNEA 1: SELECT sID, sName, GPA FROM Student WHERE GPA > 3.6;

It's pretty hard to make those two observations match up.
The "\dt" command shows that you have a table named "student",
and that that's in the "public" schema, and that "public" is
in your search_path (else \dt wouldn't have shown it).
But then the query isn't finding the table. That certainly
seems impossible if you had issued the query through psql
in the same session where you did the "\dt", so I assume that
you are issuing the query in some other way that you're not
telling us about. It's tough to give useful advice when we're
not seeing the real picture.

> and I have read it may be because of the Schema Search Path as
> https://www.postgresql.org/docs/9.1/ddl-schemas.html documents.

Well, that's a possible answer, but "public" is in the search
path by default so I don't think it's the most likely answer.

What I think is a more likely answer is that your query is being
issued in some other database than the one you did the "\dt"
command in. Check the connection parameters for whatever you're
using to issue the query.

Also, I notice that above you are connected to a database named
"Admissions" (with a capital A). I wonder if you are managing
to confuse yourself with mixed-case names. Try "\l" in psql
and see if you also have a database named "admissions" (lower
case); if so, maybe your query is being issued in that one?

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2020-01-25 15:56:08 BUG #16229: PgAdmin 4.17 show message error
Previous Message Reyna Melara 2020-01-25 00:07:47 Re: BUG #16203: So difficult to set an use postgres