Re: No relations found?

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: No relations found?
Дата
Msg-id 3DF218A7.2070109@joeconway.com
обсуждение исходный текст
Ответ на No relations found?  ("Mikael Carneholm" <SA9625@ida.utb.hb.se>)
Список pgsql-general
Mikael Carneholm wrote:
> After upgrading to the 7.3 version and putting one of my databases
> in a custom schema, I found out that the psql command
>
[snip]
>
> Strange, isn't it? I mean, shouldn't \d display all schemas &
> their tables in the current database?
>

No, it should display only the tables that are in the schemas in your
search_path. See:
   http://developer.postgresql.org/docs/postgres/runtime-config.html
(SEARCH_PATH (string) near the bottom)

To see your current search_path:

regression=# show search_path;
  search_path
--------------
  $user,public
(1 row)

Here $user is a macro which evaluates to the logged in user name. To change
your search path for a particular session:

regression=# create schema foo;
CREATE SCHEMA
regression=# create table foo.bar(f1 int);
CREATE TABLE
regression=# \d bar;
Did not find any relation named "bar".
regression=# set search_path to 'foo','public';
SET
regression=# \d bar;
        Table "foo.bar"
  Column |  Type   | Modifiers
--------+---------+-----------
  f1     | integer |

To change the search path for all users and databases, change search_path in
postgresql.conf. To change it persisently for one database, all users see the
ALTER DATABASE command:

regression=# ALTER DATABASE regression SET search_path TO 'foo','public';
ALTER DATABASE

To change the search path persisently for one user, see the ALTER USER command:
regression=# ALTER USER user1 SET search_path TO 'foo','public';
ALTER USER

HTH,

Joe


В списке pgsql-general по дате отправления:

Предыдущее
От: Joe Conway
Дата:
Сообщение: Re: native command-line console for Windows
Следующее
От: CSN
Дата:
Сообщение: Re: createlang fails