Re: pg_dump Add dumping of comments on index columns

Поиск
Список
Период
Сортировка
От higepon
Тема Re: pg_dump Add dumping of comments on index columns
Дата
Msg-id f07386410903260039k6883a6a2ue46471007c575e79@mail.gmail.com
обсуждение исходный текст
Ответ на Re: pg_dump Add dumping of comments on index columns  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: pg_dump Add dumping of comments on index columns  (Robert Haas <robertmhaas@gmail.com>)
Re: pg_dump Add dumping of comments on index columns  (Jaime Casanova <jcasanov@systemguards.com.ec>)
Список pgsql-hackers
Hi.

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?

Cheers.

-----
Taro Minowa(Higepon)

Cybozu Labs, Inc.

http://www.monaos.org/
http://code.google.com/p/mosh-scheme/


On Tue, Mar 24, 2009 at 11:56 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Bruce Momjian <bruce@momjian.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);
> CREATE TYPE
> regression=# comment on column foo.f2 is 'column of a composite type';
> COMMENT
> regression=# create table tt (f1 int primary key);
> NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "tt_pkey" for table "tt"
> CREATE TABLE
> regression=# comment on column tt_pkey.f1 is 'column of an index';
> COMMENT
>
> 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
>

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Guillaume Smet
Дата:
Сообщение: Re: New trigger option of pg_standby
Следующее
От: Tatsuhito Kasahara
Дата:
Сообщение: Re: display previous query string of idle-in-transaction