Re: Bug in psql (\dd query) - Mailing list pgsql-general

From Michael Paquier
Subject Re: Bug in psql (\dd query)
Date
Msg-id CAB7nPqT4ApZSwYxVQCVbMia9wFiCFNSPSHdxC_w5dmikkr_PXw@mail.gmail.com
Whole thread Raw
In response to Re: Bug in psql (\dd query)  (Ivan Radovanovic <radovanovic@gmail.com>)
List pgsql-general
On Wed, Aug 21, 2013 at 11:34 PM, Ivan Radovanovic
<radovanovic@gmail.com> wrote:
> On 08/21/13 16:03, Tom Lane napisa:
>
>
> Problem is if you create table in schema other than public (I am not sure if
> \dd should show comments only for objects in public schema, I assumed not?)
>
> db=# create schema test;
> CREATE SCHEMA
> db=# create table test.foo (f1 int primary key);
> NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "foo_pkey"
> for table "foo"
> CREATE TABLE
> db=# comment on constraint foo_pkey on test.foo is 'here is a comment';
> COMMENT
> db=# \dd
>
>          Object descriptions
>  Schema | Name | Object | Description
> --------+------+--------+-------------
> (0 rows)
¥dd outputs information of objects of schemas referenced in
search_path. Your example works if you change this parameter
accordingly to your new schema:
=# create schema test;
CREATE SCHEMA
=# create table test.foo (f1 int primary key);
CREATE TABLE
=# comment on constraint foo_pkey on test.foo is 'here is a comment';
COMMENT
=# \dd
         Object descriptions
 Schema | Name | Object | Description
--------+------+--------+-------------
(0 rows)

=# set search_path to 'test';
SET
=# \dd
                Object descriptions
 Schema |   Name   |   Object   |    Description
--------+----------+------------+-------------------
 test   | foo_pkey | constraint | here is a comment
(1 row)

Regards,
--
Michael


pgsql-general by date:

Previous
From: Luca Ferrari
Date:
Subject: Re: PostgreSQL 9.2 Logging
Next
From: Jiří Hlinka
Date:
Subject: Auto-build testing environment, 8.4, warm standby