Search Postgresql Archives

Unexpected behavior from psql

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a minor issue. Not really a problem for me at the moment, but I wanted to understand if it was intended:

tjhart=# \d
No relations found.
tjhart=# \dn
        List of schemas
        Name        |  Owner
--------------------+----------
 information_schema | postgres
 pg_catalog         | postgres
 pg_toast           | postgres
 pg_toast_temp_1    | postgres
 public             | postgres
(5 rows)

tjhart=# create schema foo;
CREATE SCHEMA
tjhart=# create table foo.foo_table(bar text);
CREATE TABLE
tjhart=# create table public.foo_table(bar text);
CREATE TABLE
tjhart=# create table foo.bar_table(baz text);
CREATE TABLE
tjhart=# set search_path to foo, public;
SET
tjhart=# \d
          List of relations
 Schema |   Name    | Type  | Owner
--------+-----------+-------+--------
 foo    | bar_table | table | tjhart
 foo    | foo_table | table | tjhart
(2 rows)

tjhart=# set search_path to public, foo;
SET
tjhart=# \d
          List of relations
 Schema |   Name    | Type  | Owner
--------+-----------+-------+--------
 foo    | bar_table | table | tjhart
 public | foo_table | table | tjhart
(2 rows)
tjhart=# select * from public.foo_table;
 bar
-----
(0 rows)

tjhart=# select * from foo.foo_table;
 bar
-----
(0 rows)

As you can see, one 'foo_table' is obscured from the listing, depending on the order of schemas listed in the search path. I have no problem accessing either table.

Is this intended?

--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux