Thread: RE: [GENERAL] Comments on columns?

RE: [GENERAL] Comments on columns?

From
Michael Davis
Date:
I did that and it works great.  I would like \dd tablename to show the table
comment and its column comments.

    -----Original Message-----
    From:    Bruce Momjian [SMTP:maillist@candle.pha.pa.us]
    Sent:    Friday, March 12, 1999 7:43 AM
    To:    Michael Davis
    Cc:    pgsql-general@postgreSQL.org
    Subject:    Re: [GENERAL] Comments on columns?

    > Are there any plans to have psql support comments on columns?  For
example,
    > I would like to be able to add a comment on a column of a table
and have \dd
    > display the table comment in addition to any/all column comments.


    Find the oid of the column in pg_attribute, and insert into
pg_description.

    --
      Bruce Momjian                        |  http://www.op.net/~candle
      maillist@candle.pha.pa.us            |  (610) 853-3000
      +  If your life is a hard drive,     |  830 Blythe Avenue
      +  Christ can be your backup.        |  Drexel Hill, Pennsylvania
19026

Re: [GENERAL] Comments on columns?

From
Bruce Momjian
Date:
> I did that and it works great.  I would like \dd tablename to show the table
> comment and its column comments.

Yes, I would like this too, and have considered it.  The problem I have
had with system tables is that the oid of the table and columns is
generated at initdb time, and not assigned constant values as the
pg_proc entries are.

I could modify psql to show comments, but I can't figure out how to get
the system tables to show this.

In fact, the TODO list has:

  * allow pg_descriptions when creating types, tables, columns, and functions

--
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026