Skip site navigation (1) Skip section navigation (2)

Re: pg_dump Add dumping of comments on index columns

From: higepon <higepon(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_dump Add dumping of comments on index columns
Date: 2009-03-26 07:39:41
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers

Here is a patch for pg_dump "Commenting on a composite-type column".
This patch is for Todo item named "Add dumping of comments on index
columns and composite type columns".
As Tom Lane said, this patch is not for dumping "comments on index columns",
but only for "comment on composite-type column".

With this patch, pg_dump can dump comments on composite-type column.

 -- Name: COLUMN bar.b1; Type: COMMENT; Schema: public; Owner: taro

 COMMENT ON COLUMN bar.b1 IS 'column of a composite type b1';

 -- Name: COLUMN bar.b3; Type: COMMENT; Schema: public; Owner: taro

 COMMENT ON COLUMN bar.b3 IS 'column of a composite type b3';

Would someone please review this?


Taro Minowa(Higepon)

Cybozu Labs, Inc.

On Tue, Mar 24, 2009 at 11:56 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
>> Wow, I have no idea what that means.  I am wondering if we should just
>> remove this TODO item.  We don't even support comments on indexed
>> columns, so why would pg_dump need to dump it?
> The system will let you do it, both cases:
> regression=# create type foo as (f1 int, f2 text);
> regression=# comment on column foo.f2 is 'column of a composite type';
> regression=# create table tt (f1 int primary key);
> NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "tt_pkey" for table "tt"
> regression=# comment on column tt_pkey.f1 is 'column of an index';
> and pg_dump fails to dump both cases.
> Commenting on a composite-type column seems reasonable.  I'm less happy
> about the other because it depends on the names assigned to index
> columns, which are implementation artifacts.  I'd rather see us forbid
> the case.
>                        regards, tom lane

Attachment: pg_dump_composite_type_v1.patch
Description: application/octet-stream (5.8 KB)

In response to


pgsql-hackers by date

Next:From: Tatsuhito KasaharaDate: 2009-03-26 08:16:07
Subject: Re: display previous query string of idle-in-transaction
Previous:From: Guillaume SmetDate: 2009-03-26 07:32:09
Subject: Re: New trigger option of pg_standby

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group