Re: How to retrieve Comment text using SQL, not psql?

From: Melvin Davidson <melvin6925(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: Bob Futrelle <bob(dot)futrelle(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to retrieve Comment text using SQL, not psql?
Date: 2015-05-30 14:01:34
Message-ID: CANu8FixpCuWU7fxbA63OmTsigYVXNKCeijP9dCRJy0KLyH-3_Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>select obj_description('table1'::regclass, 'pg_class');

That will only show the table comment.
My query shows that table comment AND any column comments!

On Sat, May 30, 2015 at 9:37 AM, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
wrote:

> On 05/30/2015 04:48 AM, Bob Futrelle wrote:
>
>> Using pgAdmin3 I've tried this and variations on it. All are rejected.
>>
>> select COMMENT ON TABLE articlestats
>>
>>
>> No answer here,
>>
>> http://www.postgresql.org/docs/9.3/static/sql-comment.html
>>
>>
>> pgAdmin3 had no problem with entering a comment:
>>
>> COMMENT ON TABLE articlestats IS 'Comprehensive data for every
>> article.'
>>
>
>
> http://www.postgresql.org/docs/9.4/interactive/functions-info.html
> Table 9.60 Comment Information Functions
>
>
> So:
>
> test=# comment on table table1 is 'Test comment';
> COMMENT
>
> test=# select obj_description('table1'::regclass, 'pg_class');
> obj_description
>
> -----------------
>
> Test comment
>
> (1 row)
>
>
>>
>> - Bob Futrelle
>>
>>
>
> --
> Adrian Klaver
> adrian(dot)klaver(at)aklaver(dot)com
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

--
*Melvin Davidson*
I reserve the right to fantasize. Whether or not you
wish to share my fantasy is entirely up to you.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Glyn Astill 2015-05-30 21:45:08 Re: replacing jsonb field value
Previous Message Adrian Klaver 2015-05-30 13:37:21 Re: How to retrieve Comment text using SQL, not psql?