Issue with listing same tablenames from different schemas in the search_path

From: Nikhil Sontakke <nikkhils(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Issue with listing same tablenames from different schemas in the search_path
Date: 2011-10-02 06:31:58
Message-ID: CANgU5ZenHxVLOrkA3_+6rSattKm7TJ_Xkg5hTtXPygFvV_Ow6A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Consider the following sequence of commands in a psql session:

postgres=#create table public.sample(x int);
postgres=#create schema new;
postgres=#create table new.sample(x int);
postgres=#set search_path=public,new;

postgres=#\dt
Schema | Name | Type | Owner
-------------------------------------------
public | sample | table | postgres
(1 row)

We should have seen two entries in the above listing. So looks like a bug to
me.

The issue is with the call to pg_table_is_visible(). While scanning for the
second entry, it breaks out because there is a matching entry with the same
name in the first schema. What we need is a variation of this function which
checks for visibility of the corresponding namespace in the search path and
emit it out too if so.

Thoughts? I can cook up a patch for this.

Regards,
Nikhils

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2011-10-02 06:42:56 Re: Issue with listing same tablenames from different schemas in the search_path
Previous Message Jeff Davis 2011-10-02 06:12:03 Re: Range Types - typo + NULL string constructor