RE: [GENERAL] how to see column comments?
Try \d+ test_table. Hope that helps, Mike Mascari [EMAIL PROTECTED] -Original Message- From: Norman J. Clarke [SMTP:[EMAIL PROTECTED]] Sent: Thursday, February 15, 2001 8:24 PM To: [EMAIL PROTECTED] Subject:[GENERAL] how to see column comments? Hello, I have not been able to get psql to show column comments in version 7.1beta4. Am I doing anything wrong, or is this a bug? A transcript of my psql session is below. Norm -- norman=# create table test_table (col1 integer); CREATE norman=# comment on table test_table is 'this is a table comment'; COMMENT norman=# \dd test_table Object descriptions Name| Object| Description +-+- test_table | relation(r) | this is a table comment (1 row) norman=# comment on column test_table.col1 is 'this is a column comment'; COMMENT norman=# \dd test_table.col1 Object descriptions Name | Object | Description --++- (0 rows)
Re: [GENERAL] how to see column comments?
You have to put the actual name (attribute) of the column, not "col1" On Fri, 16 Feb 2001 14:24, Norman J. Clarke wrote: Hello, I have not been able to get psql to show column comments in version 7.1beta4. Am I doing anything wrong, or is this a bug? A transcript of my psql session is below. Norm -- norman=# create table test_table (col1 integer); CREATE norman=# comment on table test_table is 'this is a table comment'; COMMENT norman=# \dd test_table Object descriptions Name| Object| Description +-+- test_table | relation(r) | this is a table comment (1 row) norman=# comment on column test_table.col1 is 'this is a column comment'; COMMENT norman=# \dd test_table.col1 Object descriptions Name | Object | Description --++- (0 rows) -- Sincerely etc., NAME Christopher Sawtell CELL PHONE 021 257 4451 ICQ UIN45863470 EMAIL csawtell @ xtra . co . nz CNOTES ftp://ftp.funet.fi/pub/languages/C/tutorials/sawtell_C.tar.gz -- Please refrain from using HTML or WORD attachments in e-mails to me --
RE: [GENERAL] how to see column comments?
Actually, I responded a bit too hastily. That looks like a bug in psql to me. I see it in 7.0.3 as well. The query that psql is generating is incorrect: SELECT relhasindex, relkind, relchecks, reltriggers, relhasrules FROM pg_class WHERE relname='table.column'; It should be querying pg_attribute. It seems \d+ tablename is currently the only way to view column comments. Hope that helps, Mike Mascari [EMAIL PROTECTED] -Original Message- From: Norman J. Clarke [SMTP:[EMAIL PROTECTED]] Sent: Thursday, February 15, 2001 8:24 PM To: [EMAIL PROTECTED] Subject:[GENERAL] how to see column comments? Hello, I have not been able to get psql to show column comments in version 7.1beta4. Am I doing anything wrong, or is this a bug? A transcript of my psql session is below. Norm -- norman=# create table test_table (col1 integer); CREATE norman=# comment on table test_table is 'this is a table comment'; COMMENT norman=# \dd test_table Object descriptions Name| Object| Description +-+- test_table | relation(r) | this is a table comment (1 row) norman=# comment on column test_table.col1 is 'this is a column comment'; COMMENT norman=# \dd test_table.col1 Object descriptions Name | Object | Description --++- (0 rows)