pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Reyna Melara <remabarca@gmail.com>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16203: So difficult to set an use postgres
Date: Fri, 24 Jan 2020 20:31:27 -0500
Message-ID: <25717.1579915887@sss.pgh.pa.us> (raw)
In-Reply-To: <CABazUzc0G57ZsGEMNwiqOtytdEQS0GNf3ZkPESo+WjA4HTKFsg@mail.gmail.com>
References: <16203-d9b2e0874d6ca215@postgresql.org>
	<20200110202818.mvgvbfnlgfz4bbsy@development>
	<CABazUzc0G57ZsGEMNwiqOtytdEQS0GNf3ZkPESo+WjA4HTKFsg@mail.gmail.com>

Reyna Melara <remabarca@gmail.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





view thread (4+ messages)

Message-ID: <25717.1579915887@sss.pgh.pa.us>
Permalink:  ../25717.1579915887@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/25717.1579915887@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, remabarca@gmail.com, tomas.vondra@2ndquadrant.com
  Subject: Re: BUG #16203: So difficult to set an use postgres
  In-Reply-To: <25717.1579915887@sss.pgh.pa.us>
  References: <16203-d9b2e0874d6ca215@postgresql.org> <20200110202818.mvgvbfnlgfz4bbsy@development> <CABazUzc0G57ZsGEMNwiqOtytdEQS0GNf3ZkPESo+WjA4HTKFsg@mail.gmail.com> <25717.1579915887@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox