Patch to add hook to copydir()

From: Swen Kooij <swenkooij(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Patch to add hook to copydir()
Date: 2019-09-02 18:54:53
Message-ID: CACUs8Ssg_m6JJgfXWn8T=-W9kLHGJ3K7R_y6gLQEVAxGmTTmOQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello all,

I've been working on an extension that tightly integrates
postgres with underlying filesystem . I need to customize
how postgres copies directories for new databases.

I first looked at the ProcessUtility_hook. This would require
me to copy or rewrite most of the createdb() function. This is
less than ideal of course. Someone on the IRC channel
suggested I could add a hook for copydir().

I implemented the hook similar to how the
ProcessUtility_hook is implemented. I couldn't find any tests
for any of the existing hooks. I've been looking at the regression
tests, but I am not entirely sure how to proceed on that front.

I tested my patch extensively against master and
the REL_12_STABLE branch. All tests pass and the patch has
been working great with my extension.

I attached a first draft of the patch against master.

---
Swen Kooij

Attachment Content-Type Size
copy-dir-hook_v1.patch text/x-patch 2.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Swen Kooij 2019-09-02 19:04:40 Re: Patch to add hook to copydir()
Previous Message Karl O. Pinc 2019-09-02 18:42:35 Re: Patch to document base64 encoding