Re: Rationalizing code-sharing among src/bin/ directories

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Rationalizing code-sharing among src/bin/ directories
Дата
Msg-id 2885.1458834730@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Rationalizing code-sharing among src/bin/ directories  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Rationalizing code-sharing among src/bin/ directories  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
I wrote:
> I have a modest proposal for improving this: let's move all the code
> that's currently shared by two or more src/bin/ subdirectories into a
> new directory, say src/feutils, and build it into a ".a" library in
> the same way that src/common/ is handled.

Moving along on this project: I'm looking at pg_dump's dumputils.c/.h,
which contains a fair amount of generally-useful stuff but also some
stuff that seems to have no earthly use outside pg_dump/pg_dumpall.
In particular I do not see the point of moving these things to a shared
directory:

PGDUMP_STRFTIME_FMT macro

extern bool buildACLCommands(const char *name, const char *subname,                const char *type, const char *acls,
constchar *owner,                const char *prefix, int remoteVersion,                PQExpBuffer sql);
 
extern bool buildDefaultACLCommands(const char *type, const char *nspname,                       const char *acls,
constchar *owner,                       int remoteVersion,                       PQExpBuffer sql);
 
extern void buildShSecLabelQuery(PGconn *conn, const char *catalog_name,                    uint32 objectId,
PQExpBuffersql);
 
extern void emitShSecLabels(PGconn *conn, PGresult *res,               PQExpBuffer buffer, const char *target, const
char*objname);
 

What I propose doing is leaving the above-listed items in
pg_dump/dumputils.h/.c, and moving the rest of what's in those files
to new files src/include/fe_utils/string_utils.h and
src/fe_utils/string_utils.c.  This name is a bit arbitrary, but most of
what's there is string processing of some flavor or other, with some list
processing thrown in for good measure.  If anyone's got a different color
to paint this bikeshed, please speak up.
        regards, tom lane



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Rationalizing code-sharing among src/bin/ directories
Следующее
От: Yury Zhuravlev
Дата:
Сообщение: Re: NOT EXIST for PREPARE