Re: Adding comments to extension objects

Поиск
Список
Период
Сортировка
Искать

Re: Adding comments to extension objects

От:
Andrew Dunstan <andrew@dunslane.net>
Дата:
Вложения:


On 2026-08-08 Sa 9:17 AM, Bruce Momjian wrote:
I think SQL object comments are very useful for users, and even more
useful now that many people are using MCP:
	https://momjian.us/main/blogs/pgblog/2026.html#March_16_2026

Would someone please volunteer to check all externally-developed
extensions to see if they have the appropriate object comments, and if
not, either create a patch to add them or contact the author suggesting
they add them.  I have done this already for pgvector:
	https://momjian.us/main/blogs/pgblog/2026.html#March_16_2026


I think we need to be more specific about what might help here. I asked Claude what sort of objects commenting on in this way would help. Here's its answer:


Always worth it: TABLE, FOREIGN TABLE, partitioned tables, COLUMN, VIEW, MATERIALIZED VIEW Why: Read by essentially every server; named directly in every query

Worth it if your server reads them: SCHEMA, FUNCTION/PROCEDURE, TYPE, DOMAIN, SERVER Why: Read by better servers, and the model can name all of them

Usually not worth it: INDEX, CONSTRAINT, TRIGGER, POLICY, SEQUENCE, OPERATOR, RULE, ROLE, DATABASE, TABLESPACE Why: Rarely fetched, and mostly not nameable in generated SQL


So, if your extension creates a Foreign Data Wrapper, as several of mine do, there's really nothing for you to do. By all means comment on it, but it is very unlikely to help an MCP server. On the other hand, if it creates functions and types, commenting on those is probably a good idea, and if it creates tables it's a very good idea.

I also asked claude for a template. It gave me one with a worked example. It's attached.


cheers


andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

Re: Adding comments to extension objects

От:
Bruce Momjian <bruce@momjian.us>
Дата:
Вложения:
On Sat, Aug  8, 2026 at 06:12:40PM -0400, Andrew Dunstan wrote:
> So, if your extension creates a Foreign Data Wrapper, as several of mine do,
> there's really nothing for you to do. By all means comment on it, but it is
> very unlikely to help an MCP server. On the other hand, if it creates functions
> and types, commenting on those is probably a good idea, and if it creates
> tables it's a very good idea.
> 
> I also asked claude for a template. It gave me one with a worked example. It's
> attached.

Great idea to use Claude.  Also, we should consider cases where it will
help users but not necessarily MCP.  FYI, pgvector already completed my
request:

	https://github.com/pgvector/pgvector/issues/1013

-- 
  Bruce Momjian          https://momjian.us
  EDB                                      https://enterprisedb.com

  Do not let urgent matters crowd out time for investment in the future.


Re: Adding comments to extension objects

От:
Hannu Krosing <hannuk@google.com>
Дата:
Вложения:
Sometimes I wish there were something like Python's docstrings where
you can get more detailed usage instructions interactively.

So something like comments, but more detailed.

It could be exposed as CALL HELP() returning whatever
is there in the system.

On Sun, Aug 9, 2026 at 1:48 AM Bruce Momjian  wrote:
>
> On Sat, Aug  8, 2026 at 06:12:40PM -0400, Andrew Dunstan wrote:
> > So, if your extension creates a Foreign Data Wrapper, as several of mine do,
> > there's really nothing for you to do. By all means comment on it, but it is
> > very unlikely to help an MCP server. On the other hand, if it creates functions
> > and types, commenting on those is probably a good idea, and if it creates
> > tables it's a very good idea.
> >
> > I also asked claude for a template. It gave me one with a worked example. It's
> > attached.
>
> Great idea to use Claude.  Also, we should consider cases where it will
> help users but not necessarily MCP.  FYI, pgvector already completed my
> request:
>
>         https://github.com/pgvector/pgvector/issues/1013
>
> --
>   Bruce Momjian          https://momjian.us
>   EDB                                      https://enterprisedb.com
>
>   Do not let urgent matters crowd out time for investment in the future.
>
>


FAQ