#
# Makefile for pg_upgrade
#
-# targets: all, clean, install, uninstall
-#
-# This Makefile generates an executable and a shared object file
-#
PGFILEDESC = "pg_upgrade - an in-place binary upgrade utility"
PGAPPICON = win32
option.o page.o pg_upgrade.o relfilenode.o server.o \
tablespace.o util.o version.o version_old_8_3.o $(WIN32RES)
-MODULES = pg_upgrade_sysoids
-
PG_CPPFLAGS = -DFRONTEND -DDLSUFFIX=\"$(DLSUFFIX)\" -I$(srcdir) -I$(libpq_srcdir)
PG_LIBS = $(libpq_pgport)
FILE *lib_test;
/*
- * Test pg_upgrade_sysoids.so is in the proper place. We cannot copy it
+ * Test pg_upgrade_support.so is in the proper place. We cannot copy it
* ourselves because install directories are typically root-owned.
*/
- snprintf(libfile, sizeof(libfile), "%s/pg_upgrade_sysoids%s", ctx->new.libpath,
+ snprintf(libfile, sizeof(libfile), "%s/pg_upgrade_support%s", ctx->new.libpath,
DLSUFFIX);
if ((lib_test = fopen(libfile, "r")) == NULL)
pg_log(ctx, PG_FATAL,
- "\npg_upgrade%s must be created and installed in %s\n", DLSUFFIX, libfile);
+ "\npg_upgrade_support%s must be created and installed in %s\n", DLSUFFIX, libfile);
else
fclose(lib_test);
"CREATE OR REPLACE FUNCTION "
" binary_upgrade.set_next_pg_type_oid(OID) "
"RETURNS VOID "
- "AS '$libdir/pg_upgrade_sysoids' "
+ "AS '$libdir/pg_upgrade_support' "
"LANGUAGE C STRICT;"));
PQclear(executeQueryOrDie(ctx, conn,
"CREATE OR REPLACE FUNCTION "
" binary_upgrade.set_next_pg_type_array_oid(OID) "
"RETURNS VOID "
- "AS '$libdir/pg_upgrade_sysoids' "
+ "AS '$libdir/pg_upgrade_support' "
"LANGUAGE C STRICT;"));
PQclear(executeQueryOrDie(ctx, conn,
"CREATE OR REPLACE FUNCTION "
" binary_upgrade.set_next_pg_type_toast_oid(OID) "
"RETURNS VOID "
- "AS '$libdir/pg_upgrade_sysoids' "
+ "AS '$libdir/pg_upgrade_support' "
"LANGUAGE C STRICT;"));
PQclear(executeQueryOrDie(ctx, conn,
"CREATE OR REPLACE FUNCTION "
" binary_upgrade.set_next_heap_relfilenode(OID) "
"RETURNS VOID "
- "AS '$libdir/pg_upgrade_sysoids' "
+ "AS '$libdir/pg_upgrade_support' "
"LANGUAGE C STRICT;"));
PQclear(executeQueryOrDie(ctx, conn,
"CREATE OR REPLACE FUNCTION "
" binary_upgrade.set_next_toast_relfilenode(OID) "
"RETURNS VOID "
- "AS '$libdir/pg_upgrade_sysoids' "
+ "AS '$libdir/pg_upgrade_support' "
"LANGUAGE C STRICT;"));
PQclear(executeQueryOrDie(ctx, conn,
"CREATE OR REPLACE FUNCTION "
" binary_upgrade.set_next_index_relfilenode(OID) "
"RETURNS VOID "
- "AS '$libdir/pg_upgrade_sysoids' "
+ "AS '$libdir/pg_upgrade_support' "
"LANGUAGE C STRICT;"));
PQclear(executeQueryOrDie(ctx, conn,
"CREATE OR REPLACE FUNCTION "
" binary_upgrade.add_pg_enum_label(OID, OID, NAME) "
"RETURNS VOID "
- "AS '$libdir/pg_upgrade_sysoids' "
+ "AS '$libdir/pg_upgrade_support' "
"LANGUAGE C STRICT;"));
PQfinish(conn);
}
--- /dev/null
+#
+# Makefile for pg_upgrade_support
+#
+
+PGFILEDESC = "pg_upgrade_support - shared library functions for pg_upgrade"
+
+MODULES = pg_upgrade_support
+
+ifdef USE_PGXS
+PG_CONFIG = pg_config
+PGXS := $(shell $(PG_CONFIG) --pgxs)
+include $(PGXS)
+else
+subdir = contrib/pg_upgrade
+top_builddir = ../..
+include $(top_builddir)/src/Makefile.global
+include $(top_srcdir)/contrib/contrib-global.mk
+endif