It's bizarre how you can comment on columns in composite types!

CREATE TYPE test (a int4, b int4);
COMMENT ON COLUMN test.a IS 'A column';

Seems harmless, but should we allow it?

Chris


Mon, 26 Jul 2004 13:26:37 +0800
Christopher Kings-Lynne <chriskl@familyhealth.com.au>
Weird...but correct?
> CREATE TYPE test (a int4, b int4);
> COMMENT ON COLUMN test.a IS 'A column';
> 
> Seems harmless, but should we allow it?

Actually, currently it's bad because such comments will not be dumped by 
pg_dump.  Shall I fix pg_dump?

Chris


Mon, 26 Jul 2004 14:47:29 +0800
Christopher Kings-Lynne <chriskl@familyhealth.com.au>
Re: Weird...but correct?
Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:
> It's bizarre how you can comment on columns in composite types!
> CREATE TYPE test (a int4, b int4);
> COMMENT ON COLUMN test.a IS 'A column';

And not only that, but:

regression=# \d+ test
 Composite type "public.test"
 Column |  Type   | Description
--------+---------+-------------
 a      | integer | A column
 b      | integer |

> Seems harmless, but should we allow it?

Why not?

> Shall I fix pg_dump?

Yes please, if it doesn't seem outlandishly hard.  (From memory it might
just be adding a subroutine call to dumpType...)

			regards, tom lane

Mon, 26 Jul 2004 10:46:56 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: Weird...but correct? 