Re: Instructions for adding new catalog

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Instructions for adding new catalog
Дата
Msg-id 19575.1217819052@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Instructions for adding new catalog  ("Gustavo Tonini" <gustavotonini@gmail.com>)
Список pgsql-hackers
"Gustavo Tonini" <gustavotonini@gmail.com> writes:
> Well, just for documenting the process...
> Adding new postgres catalog in 2 little steps:

> 1)Write catalog header file and save it into "src/include/catalog"
> directory. Hint: copy format from other catalog headers.
> 2)Add your header file name to variable POSTGRES_BKI_SRCS in file
> "src/backend/catalog/Makefile"

As long as we're documenting ...

* Documenting a new catalog in catalogs.sgml is not considered optional.
* Most likely, your catalog needs some indexes, which should be declared in catalog/indexing.h.
* Of course, the reason you are defining a new system catalog is that the C code is going to know about it.  So there
isa whole lot of other stuff you probably need to write: object insertion code, object deletion code, lookup code
(maybea new syscache or two). Traditionally the lowest-level insertion/deletion code goes into
catalog/pg_yourcatalog.c,while slightly higher-level code such as the implementation of new utility commands to manage
thisnew kind of object will go elsewhere.
 

That's before you get to any actual new functionality...
        regards, tom lane


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

Предыдущее
От: Robert Treat
Дата:
Сообщение: Re: Mini improvement: statement_cost_limit
Следующее
От: Sushant Sinha
Дата:
Сообщение: Re: small bug in hlCover