Unix Technical Forum

BUG #1803: Incomplete table list in psql

This is a discussion on BUG #1803: Incomplete table list in psql within the pgsql Bugs forums, part of the PostgreSQL category; --> The following bug has been logged online: Bug reference: 1803 Logged by: DKnoto Email address: dknoto@wiml.waw.pl PostgreSQL version: 8.0.3 ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Bugs

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 10:04 AM
DKnoto
 
Posts: n/a
Default BUG #1803: Incomplete table list in psql


The following bug has been logged online:

Bug reference: 1803
Logged by: DKnoto
Email address: dknoto@wiml.waw.pl
PostgreSQL version: 8.0.3
Operating system: Linux 2.6.11.10
Description: Incomplete table list in psql
Details:

Hi,
I have database with two schemas: S1 and S2. In each schema exist table T1
but psql show only table in first schema listet in SEARCH_PATH.
Best regards
DKnoto.

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 10:04 AM
Michael Fuhr
 
Posts: n/a
Default Re: BUG #1803: Incomplete table list in psql

On Wed, Aug 03, 2005 at 10:29:38AM +0100, DKnoto wrote:
> I have database with two schemas: S1 and S2. In each schema exist table T1
> but psql show only table in first schema listet in SEARCH_PATH.


Is this what you mean?

CREATE SCHEMA s1;
CREATE TABLE s1.t1 (x integer);

CREATE SCHEMA s2;
CREATE TABLE s2.t1 (y integer);
CREATE TABLE s2.t2 (z integer);

SET search_path TO s1, s2;

\dt
List of relations
Schema | Name | Type | Owner
--------+------+-------+-------
s1 | t1 | table | mfuhr
s2 | t2 | table | mfuhr
(2 rows)

Note what the psql documentation says about the \d command and an
object's visibility:

A pattern that contains an (unquoted) dot is interpreted as a schema
name pattern followed by an object name pattern. For example, \dt
foo*.bar* displays all tables in schemas whose name starts with foo
and whose table name starts with bar. If no dot appears, then the
pattern matches only objects that are visible in the current schema
search path.

Whenever the pattern parameter is omitted completely, the \d
commands display all objects that are visible in the current schema
search path. To see all objects in the database, use the pattern *.*.

psql uses pg_table_is_visible() to determine tables' visibility,
and the documentation for that function says:

A table is said to be visible if its containing schema is in the
search path and no table of the same name appears earlier in the
search path. This is equivalent to the statement that the table can
be referenced by name without explicit schema qualification.

--
Michael Fuhr

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:46 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com