Re: WIP: a way forward on bootstrap data

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: WIP: a way forward on bootstrap data
Дата
Msg-id 20171221223237.tweqapdglenjek45@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: WIP: a way forward on bootstrap data  (John Naylor <jcnaylor@gmail.com>)
Ответы Re: WIP: a way forward on bootstrap data  (Robert Haas <robertmhaas@gmail.com>)
Re: WIP: a way forward on bootstrap data  (John Naylor <jcnaylor@gmail.com>)
Список pgsql-hackers
Hmm, patch 0008 removes data lines from the .h but leaves the dependent
OID define lines around:

#define BTREE_AM_OID 403

This is not good, because then the define depends on data that appears
in a distant file.  Another consideration is that the current system has
the property that these OIDs are discoverable by a hacker by navigating
to the containing .h file; and a missing symbol is easily fixable if
they need to hardcode the OID for which there isn't a symbol yet.

Maybe a generated .h file containing defines for OIDs from all catalogs
is okay.  Of course, not all symbols are to be listed -- we should have
a special marker in the data lines for those that are.  Maybe something
like this

{ oid => '403', descr => 'b-tree index access method',
  amname => 'btree', amhandler => 'bthandler', amtype => 'i',
  cpp_symbol => 'BTREE_AM_OID' },

(where 'cpp_symbol' would be skipped by genbki explicitly).

Any better ideas?

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: WIP: a way forward on bootstrap data
Следующее
От: Gene Selkov
Дата:
Сообщение: Re: genomic locus