Unexpected behavior from psql

From: Tim Hart <tjhart(at)mac(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Unexpected behavior from psql
Date: 2009-01-11 21:33:28
Message-ID: 2148546B-DFEA-4424-A39E-1E2778F641D1@mac.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Davis 2009-01-11 22:41:24 Re: Unexpected behavior from psql
Previous Message Joshua D. Drake 2009-01-11 19:52:40 PostgreSQL Conference / PgCon.US update