On Sun, Jun 07, 2020 at 10:05:03PM +0300, Alexander Korotkov wrote:
> On Sat, Jun 6, 2020 at 8:49 PM Peter Eisentraut
> <peter.eisentraut@2ndquadrant.com> wrote:
>> Why is fe_archive.c in src/common/ and not in src/fe_utils/? It is not
>> "common" to frontend and backend.
>
> Yep, this seems wrong to me. I can propose following file rename.
>
> src/common/fe_archive.c => src/fe_utils/archive.c
> include/common/fe_archive.h => include/fe_utils/archive.h
Is it technically a problem though? fe_archive.c is listed as a
frontend-only file with OBJS_FRONTEND in src/common/Makefile. Anyway,
for this one I would not mind to do the move so please see the
attached, but I am not completely sure either why src/fe_utils/ had
better be chosen than src/common/.
>> It actually defines functions that clash with functions in the backend,
>> so this seems doubly wrong.
>
> Let's have frontend version of RestoreArchivedFile() renamed as well.
> What about RestoreArchivedFileFrontend()?
-1 from me for the renaming, which was intentional to ease grepping
with the backend counterpart. We have other cases like that, say
palloc(), fsync_fname(), etc.
Perhaps we have more things that are frontend-only in src/common/ that
could be moved to src/fe_utils/? I am looking at restricted_token.c,
fe_memutils.c, logging.c and file_utils.c here, but that would mean
breaking a couple of declarations, something never free for plugin
developers.
--
Michael