opnsense-ports/databases/pgespresso/files/patch-pgespresso.c

43 lines
1.2 KiB
C

--- pgespresso.c.orig 2014-04-11 10:46:36 UTC
+++ pgespresso.c
@@ -78,10 +78,38 @@ pgespresso_start_backup(PG_FUNCTION_ARGS
}
/*
+ * Starting from 9.5 the do_pg_start_backup caller needs to allocate the
+ * 'pg_tblspc' directory and pass it as argument.
+ *
+ * Ref: http://git.postgresql.org/gitweb/?p=postgresql.git;h=72d422a
+ */
+ #if PG_VERSION_NUM >= 90500
+ {
+ DIR *dir;
+
+ /* Make sure we can open the directory with
+ tablespaces in it */
+ dir = AllocateDir("pg_tblspc");
+
+ if (!dir)
+ ereport(ERROR,
+ (errmsg("could not open directory \"%s\": %m", "pg_tblspc")));
+
+ /*
+ * We are not filling the tablespace map here.
+ * This means that on 9.5 the 'tablespace_map' file has to be
+ * generated by the invoker.
+ */
+ do_pg_start_backup(backupidstr, fast, NULL, &labelfile,
+ dir, NULL, NULL, false, false);
+
+ FreeDir(dir);
+ }
+ /*
* Starting from 9.3 the do_pg_start_backup returns the timeline ID
* in *starttli_p additional argument
*/
- #if PG_VERSION_NUM >= 90300
+ #elif PG_VERSION_NUM >= 90300
do_pg_start_backup(backupidstr, fast, NULL, &labelfile);
#else
do_pg_start_backup(backupidstr, fast, &labelfile);