Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions lib/repack.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,23 @@
#include "utils/ruleutils.h"
#endif

#ifdef REPACK_VERSION
/* macro trick to stringify a macro expansion */
#define xstr(s) str(s)
#define str(s) #s
#define LIBRARY_VERSION xstr(REPACK_VERSION)
#else
#define LIBRARY_VERSION "unknown"
#endif

#if PG_VERSION_NUM >= 180000
PG_MODULE_MAGIC_EXT(
.name = "pg_repack",
.version = LIBRARY_VERSION
);
#else
PG_MODULE_MAGIC;
#endif

extern Datum PGUT_EXPORT repack_version(PG_FUNCTION_ARGS);
extern Datum PGUT_EXPORT repack_trigger(PG_FUNCTION_ARGS);
Expand Down Expand Up @@ -136,15 +152,6 @@ must_be_owner(Oid relId)
#define RENAME_INDEX(relid, newrelname) RenameRelationInternal(relid, newrelname, true, true);
#endif

#ifdef REPACK_VERSION
/* macro trick to stringify a macro expansion */
#define xstr(s) str(s)
#define str(s) #s
#define LIBRARY_VERSION xstr(REPACK_VERSION)
#else
#define LIBRARY_VERSION "unknown"
#endif

Datum
repack_version(PG_FUNCTION_ARGS)
{
Expand Down
Loading