dbTalk Databases Forums  

[BUGS] BUG #1803: Incomplete table list in psql

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #1803: Incomplete table list in psql in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
DKnoto
 
Posts: n/a

Default [BUGS] BUG #1803: Incomplete table list in psql - 08-05-2005 , 12:19 AM







The following bug has been logged online:

Bug reference: 1803
Logged by: DKnoto
Email address: dknoto (AT) wiml (DOT) 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

Reply With Quote
  #2  
Old   
Michael Fuhr
 
Posts: n/a

Default Re: [BUGS] BUG #1803: Incomplete table list in psql - 08-05-2005 , 08:55 AM






On Wed, Aug 03, 2005 at 10:29:38AM +0100, DKnoto wrote:
Quote:
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


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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.