pgsql: walmethods.c/h: Make WalWriteMethod more object-oriented.

Поиск
Список
Период
Сортировка
От Robert Haas
Тема pgsql: walmethods.c/h: Make WalWriteMethod more object-oriented.
Дата
Msg-id E1oaK7W-0014Qm-NJ@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
walmethods.c/h: Make WalWriteMethod more object-oriented.

Normally when we use object-oriented programming techniques, we
provide a pointer to an object and then some way of looking up the
associated table of callbacks, but walmethods.c/h took the alternative
approach of providing only a pointer to the table of callbacks and
thus imposed the artificial restriction that there could only ever be
one object of each type, so that the callbacks could find it via a
global variable. That doesn't seem like the right idea, so revise the
approach.

Each callback which does not already have an argument of type
Walfile * now takes a pointer to the relevant WalWriteMethod *
so that these callbacks need not rely on there being only one
object of each type.

Freeing a WalWriteMethod is now performed via a callback provided
for that purpose rather than requiring the caller to know which
WAL method they want to free.

Discussion: http://postgr.es/m/CA+TgmoZS0Kw98fOoAcGz8B9iDhdqB4Be4e=vDZaJZ5A-xMYBqA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/ebfb814f7ce0d5ab6f47f0b86db51a1b8f3342f4

Modified Files
--------------
src/bin/pg_basebackup/pg_basebackup.c |   8 +-
src/bin/pg_basebackup/pg_receivewal.c |   6 +-
src/bin/pg_basebackup/receivelog.c    |  89 +++---
src/bin/pg_basebackup/walmethods.c    | 510 ++++++++++++++++++----------------
src/bin/pg_basebackup/walmethods.h    |  60 ++--
5 files changed, 357 insertions(+), 316 deletions(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Future-proof the recursion inside ExecShutdownNode().
Следующее
От: Robert Haas
Дата:
Сообщение: pgsql: Make ALTER DEFAULT PRIVILEGES require privileges, not membership