open.diff

text/x-diff

Filename: open.diff
Type: text/x-diff
Part: 0
Message: Re: pg_upgrade not detecting version properly

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: unified
File+
contrib/pg_upgrade/server.c 0 0
diff --git a/contrib/pg_upgrade/server.c b/contrib/pg_upgrade/server.c
new file mode 100644
index 11e7e75..a9f9d85
*** a/contrib/pg_upgrade/server.c
--- b/contrib/pg_upgrade/server.c
*************** get_major_server_version(ClusterInfo *cl
*** 149,155 ****
  	snprintf(ver_filename, sizeof(ver_filename), "%s/PG_VERSION",
  			 cluster->pgdata);
  	if ((version_fd = fopen(ver_filename, "r")) == NULL)
! 		return 0;
  
  	if (fscanf(version_fd, "%63s", cluster->major_version_str) == 0 ||
  		sscanf(cluster->major_version_str, "%d.%d", &integer_version,
--- 149,155 ----
  	snprintf(ver_filename, sizeof(ver_filename), "%s/PG_VERSION",
  			 cluster->pgdata);
  	if ((version_fd = fopen(ver_filename, "r")) == NULL)
! 		pg_log(PG_FATAL, "could not open version file: %s\n", ver_filename);
  
  	if (fscanf(version_fd, "%63s", cluster->major_version_str) == 0 ||
  		sscanf(cluster->major_version_str, "%d.%d", &integer_version,