Thread: unable to see other schemas besides public

unable to see other schemas besides public

From
Gabriel Ramirez
Date:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

in a database I created a schema, but as superuser or as an user of that
schema I'm unable to see a listing of the schema contents. I'm running
postgresql 8.2.5, compiled via macports under Mac OS X 10.4.10 commands
and output follows:

soporte_misc=# create  schema test1;
CREATE SCHEMA
soporte_misc=# create table test1.mytable (
  username varchar(64),
  rolename text
);
CREATE TABLE
soporte_misc=# \z
                       Access privileges for database "soporte_misc"
 Schema |          Name          |   Type   |               Access
privileges
-
--------+------------------------+----------+-----------------------------------------------
 public | numero_en_letra        | table    |
{postgres=arwdxt/postgres,gabriel=r/postgres}
 public | numero_en_letra_id_seq | sequence |
(2 rows)

I was expecting the test1.mytable listed above

soporte_misc=# \z test1
Access privileges for database "soporte_misc"
 Schema | Name | Type | Access privileges
- --------+------+------+-------------------
(0 rows)

soporte_misc=# \z test1.mytable
Access privileges for database "soporte_misc"
 Schema |  Name   | Type  | Access privileges
- --------+---------+-------+-------------------
 test1  | mytable | table |
(1 row)

with \dt:

soporte_misc=# \dt
              List of relations
 Schema |      Name       | Type  |  Owner
- --------+-----------------+-------+----------
 public | numero_en_letra | table | postgres
(1 row)

soporte_misc=# \dt test1
No matching relations found.
soporte_misc=# \dt test1.mytable
          List of relations
 Schema |  Name   | Type  |  Owner
- --------+---------+-------+----------
 test1  | mytable | table | postgres
(1 row)

now creating one index:

soporte_misc=# create index myindex on test1.mytable(username);
CREATE INDEX

soporte_misc=# \di
No relations found.
soporte_misc=# \di test1
No matching relations found.
soporte_misc=# \di test1.myindex
               List of relations
 Schema |  Name   | Type  |  Owner   |  Table
- --------+---------+-------+----------+---------
 test1  | myindex | index | postgres | mytable
(1 row)

soporte_misc=#

so seems if one don't specified the schemaname.objects to list the
database don't return them, or maybe I'm missing a step after creating
the schema and objects to be able to list them.

granting all privileges on the schema and objects don't change the
output above. only once I was able to see the schemas and objects with a
normal user account (existing only in postgres) but now I'm unable to
reproduce that.

thanks in advance,


Gabriel


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHSMlNqaKauFbtmoERAvyuAJ94pQk1r8shEk1w4SaQGhSnfi84AQCfXPF0
16odzaj/SiBTdPIIizQFNKM=
=yiGP
-----END PGP SIGNATURE-----






      ____________________________________________________________________________________
Get easy, one-click access to your favorites.
Make Yahoo! your homepage.
http://www.yahoo.com/r/hs

Re: unable to see other schemas besides public

From
Euler Taveira de Oliveira
Date:
Gabriel Ramirez wrote:

> so seems if one don't specified the schemaname.objects to list the
> database don't return them, or maybe I'm missing a step after creating
> the schema and objects to be able to list them.
>
This is not a bug. You need to set your schema in the search_path [1].

[1]
http://www.postgresql.org/docs/8.3/static/ddl-schemas.html#DDL-SCHEMAS-PATH


--
  Euler Taveira de Oliveira
  http://www.timbira.com/

Re: unable to see other schemas besides public

From
Gabriel Ramirez
Date:
Euler Taveira de Oliveira wrote:
> Gabriel Ramirez wrote:
>
>> so seems if one don't specified the schemaname.objects to list the
>> database don't return them, or maybe I'm missing a step after creating
>> the schema and objects to be able to list them.
>>
> This is not a bug. You need to set your schema in the search_path [1].
>
> [1]
> http://www.postgresql.org/docs/8.3/static/ddl-schemas.html#DDL-SCHEMAS-PATH
>
>

thanks that resolved my problem.

regards,

Gabriel