mirror of
https://github.com/postgres/postgres.git
synced 2025-04-22 23:02:54 +03:00
Remove all mentions of EnterpriseDB Advanced Server from pg_upgrade;
EDB must maintain their own patch set for this.
This commit is contained in:
parent
382ff21203
commit
36d3afd2d4
@ -149,10 +149,10 @@ issue_warnings(migratorContext *ctx, char *sequence_script_file_name)
|
|||||||
{
|
{
|
||||||
prep_status(ctx, "Adjusting sequences");
|
prep_status(ctx, "Adjusting sequences");
|
||||||
exec_prog(ctx, true,
|
exec_prog(ctx, true,
|
||||||
SYSTEMQUOTE "\"%s/%s\" --set ON_ERROR_STOP=on --port %d "
|
SYSTEMQUOTE "\"%s/psql\" --set ON_ERROR_STOP=on --port %d "
|
||||||
"-f \"%s\" --dbname template1 >> \"%s\"" SYSTEMQUOTE,
|
"-f \"%s\" --dbname template1 >> \"%s\"" SYSTEMQUOTE,
|
||||||
ctx->new.bindir, ctx->new.psql_exe, ctx->new.port,
|
ctx->new.bindir, ctx->new.port, sequence_script_file_name,
|
||||||
sequence_script_file_name, ctx->logfile);
|
ctx->logfile);
|
||||||
unlink(sequence_script_file_name);
|
unlink(sequence_script_file_name);
|
||||||
pg_free(sequence_script_file_name);
|
pg_free(sequence_script_file_name);
|
||||||
check_ok(ctx);
|
check_ok(ctx);
|
||||||
|
@ -9,10 +9,6 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#ifdef EDB_NATIVE_LANG
|
|
||||||
#include "access/tuptoaster.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* get_control_data()
|
* get_control_data()
|
||||||
@ -88,15 +84,6 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
|
|||||||
got_float8_pass_by_value = true;
|
got_float8_pass_by_value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef EDB_NATIVE_LANG
|
|
||||||
/* EDB AS 8.3 is an 8.2 code base */
|
|
||||||
if (cluster->is_edb_as && GET_MAJOR_VERSION(cluster->major_version) <= 803)
|
|
||||||
{
|
|
||||||
cluster->controldata.toast = TOAST_MAX_CHUNK_SIZE;
|
|
||||||
got_toast = true;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* we have the result of cmd in "output". so parse it line by line now */
|
/* we have the result of cmd in "output". so parse it line by line now */
|
||||||
while (fgets(bufin, sizeof(bufin), output))
|
while (fgets(bufin, sizeof(bufin), output))
|
||||||
{
|
{
|
||||||
@ -140,9 +127,7 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
|
|||||||
p++; /* removing ':' char */
|
p++; /* removing ':' char */
|
||||||
cluster->controldata.cat_ver = (uint32) atol(p);
|
cluster->controldata.cat_ver = (uint32) atol(p);
|
||||||
}
|
}
|
||||||
else if ((p = strstr(bufin, "First log file ID after reset:")) != NULL ||
|
else if ((p = strstr(bufin, "First log file ID after reset:")) != NULL)
|
||||||
(cluster->is_edb_as && GET_MAJOR_VERSION(cluster->major_version) <= 803 &&
|
|
||||||
(p = strstr(bufin, "Current log file ID:")) != NULL))
|
|
||||||
{
|
{
|
||||||
p = strchr(p, ':');
|
p = strchr(p, ':');
|
||||||
|
|
||||||
@ -153,9 +138,7 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
|
|||||||
cluster->controldata.logid = (uint32) atol(p);
|
cluster->controldata.logid = (uint32) atol(p);
|
||||||
got_log_id = true;
|
got_log_id = true;
|
||||||
}
|
}
|
||||||
else if ((p = strstr(bufin, "First log file segment after reset:")) != NULL ||
|
else if ((p = strstr(bufin, "First log file segment after reset:")) != NULL)
|
||||||
(cluster->is_edb_as && GET_MAJOR_VERSION(cluster->major_version) <= 803 &&
|
|
||||||
(p = strstr(bufin, "Next log file segment:")) != NULL))
|
|
||||||
{
|
{
|
||||||
p = strchr(p, ':');
|
p = strchr(p, ':');
|
||||||
|
|
||||||
|
@ -11,8 +11,7 @@
|
|||||||
|
|
||||||
|
|
||||||
static void checkBinDir(migratorContext *ctx, ClusterInfo *cluster);
|
static void checkBinDir(migratorContext *ctx, ClusterInfo *cluster);
|
||||||
static int check_exec(migratorContext *ctx, const char *dir, const char *cmdName,
|
static int check_exec(migratorContext *ctx, const char *dir, const char *cmdName);
|
||||||
const char *alternative);
|
|
||||||
static const char *validate_exec(const char *path);
|
static const char *validate_exec(const char *path);
|
||||||
static int check_data_dir(migratorContext *ctx, const char *pg_data);
|
static int check_data_dir(migratorContext *ctx, const char *pg_data);
|
||||||
|
|
||||||
@ -89,22 +88,10 @@ verify_directories(migratorContext *ctx)
|
|||||||
static void
|
static void
|
||||||
checkBinDir(migratorContext *ctx, ClusterInfo *cluster)
|
checkBinDir(migratorContext *ctx, ClusterInfo *cluster)
|
||||||
{
|
{
|
||||||
check_exec(ctx, cluster->bindir, "postgres", "edb-postgres");
|
check_exec(ctx, cluster->bindir, "postgres");
|
||||||
check_exec(ctx, cluster->bindir, "pg_ctl", NULL);
|
check_exec(ctx, cluster->bindir, "psql");
|
||||||
check_exec(ctx, cluster->bindir, "pg_dumpall", NULL);
|
check_exec(ctx, cluster->bindir, "pg_ctl");
|
||||||
|
check_exec(ctx, cluster->bindir, "pg_dumpall");
|
||||||
#ifdef EDB_NATIVE_LANG
|
|
||||||
/* check for edb-psql first because we need to detect EDB AS */
|
|
||||||
if (check_exec(ctx, cluster->bindir, "edb-psql", "psql") == 1)
|
|
||||||
{
|
|
||||||
cluster->psql_exe = "edb-psql";
|
|
||||||
cluster->is_edb_as = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
#else
|
|
||||||
if (check_exec(ctx, cluster->bindir, "psql", NULL) == 1)
|
|
||||||
#endif
|
|
||||||
cluster->psql_exe = "psql";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -146,8 +133,7 @@ is_server_running(migratorContext *ctx, const char *datadir)
|
|||||||
* a valid executable, this function returns 0 to indicated failure.
|
* a valid executable, this function returns 0 to indicated failure.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
check_exec(migratorContext *ctx, const char *dir, const char *cmdName,
|
check_exec(migratorContext *ctx, const char *dir, const char *cmdName)
|
||||||
const char *alternative)
|
|
||||||
{
|
{
|
||||||
char path[MAXPGPATH];
|
char path[MAXPGPATH];
|
||||||
const char *errMsg;
|
const char *errMsg;
|
||||||
@ -155,21 +141,9 @@ check_exec(migratorContext *ctx, const char *dir, const char *cmdName,
|
|||||||
snprintf(path, sizeof(path), "%s%c%s", dir, pathSeparator, cmdName);
|
snprintf(path, sizeof(path), "%s%c%s", dir, pathSeparator, cmdName);
|
||||||
|
|
||||||
if ((errMsg = validate_exec(path)) == NULL)
|
if ((errMsg = validate_exec(path)) == NULL)
|
||||||
{
|
|
||||||
return 1; /* 1 -> first alternative OK */
|
return 1; /* 1 -> first alternative OK */
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
pg_log(ctx, PG_FATAL, "check for %s failed - %s\n", cmdName, errMsg);
|
||||||
if (alternative)
|
|
||||||
{
|
|
||||||
report_status(ctx, PG_WARNING, "check for %s warning: %s",
|
|
||||||
cmdName, errMsg);
|
|
||||||
if (check_exec(ctx, dir, alternative, NULL) == 1)
|
|
||||||
return 2; /* 2 -> second alternative OK */
|
|
||||||
}
|
|
||||||
else
|
|
||||||
pg_log(ctx, PG_FATAL, "check for %s failed - %s\n", cmdName, errMsg);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0; /* 0 -> neither alternative is acceptable */
|
return 0; /* 0 -> neither alternative is acceptable */
|
||||||
}
|
}
|
||||||
|
@ -9,10 +9,6 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
||||||
#ifdef EDB_NATIVE_LANG
|
|
||||||
#include <fcntl.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -291,8 +291,6 @@ get_rel_infos(migratorContext *ctx, const DbInfo *dbinfo,
|
|||||||
RelInfoArr *relarr, Cluster whichCluster)
|
RelInfoArr *relarr, Cluster whichCluster)
|
||||||
{
|
{
|
||||||
PGconn *conn = connectToServer(ctx, dbinfo->db_name, whichCluster);
|
PGconn *conn = connectToServer(ctx, dbinfo->db_name, whichCluster);
|
||||||
bool is_edb_as = (whichCluster == CLUSTER_OLD) ?
|
|
||||||
ctx->old.is_edb_as : ctx->new.is_edb_as;
|
|
||||||
PGresult *res;
|
PGresult *res;
|
||||||
RelInfo *relinfos;
|
RelInfo *relinfos;
|
||||||
int ntups;
|
int ntups;
|
||||||
@ -341,38 +339,7 @@ get_rel_infos(migratorContext *ctx, const DbInfo *dbinfo,
|
|||||||
FirstNormalObjectId,
|
FirstNormalObjectId,
|
||||||
/* see the comment at the top of v8_3_create_sequence_script() */
|
/* see the comment at the top of v8_3_create_sequence_script() */
|
||||||
(GET_MAJOR_VERSION(ctx->old.major_version) <= 803) ?
|
(GET_MAJOR_VERSION(ctx->old.major_version) <= 803) ?
|
||||||
"" : " OR relkind = 'S'",
|
"" : " OR relkind = 'S'");
|
||||||
|
|
||||||
/*
|
|
||||||
* EDB AS installs pgagent by default via initdb. We have to ignore it,
|
|
||||||
* and not migrate any old table contents.
|
|
||||||
*/
|
|
||||||
(is_edb_as && strcmp(dbinfo->db_name, "edb") == 0) ?
|
|
||||||
" AND "
|
|
||||||
" n.nspname != 'pgagent' AND "
|
|
||||||
/* skip pgagent TOAST tables */
|
|
||||||
" c.oid NOT IN "
|
|
||||||
" ( "
|
|
||||||
" SELECT c2.reltoastrelid "
|
|
||||||
" FROM pg_catalog.pg_class c2 JOIN "
|
|
||||||
" pg_catalog.pg_namespace n2 "
|
|
||||||
" ON c2.relnamespace = n2.oid "
|
|
||||||
" WHERE n2.nspname = 'pgagent' AND "
|
|
||||||
" c2.reltoastrelid != 0 "
|
|
||||||
" ) AND "
|
|
||||||
/* skip pgagent TOAST table indexes */
|
|
||||||
" c.oid NOT IN "
|
|
||||||
" ( "
|
|
||||||
" SELECT c3.reltoastidxid "
|
|
||||||
" FROM pg_catalog.pg_class c2 JOIN "
|
|
||||||
" pg_catalog.pg_namespace n2 "
|
|
||||||
" ON c2.relnamespace = n2.oid JOIN "
|
|
||||||
" pg_catalog.pg_class c3 "
|
|
||||||
" ON c2.reltoastrelid = c3.oid "
|
|
||||||
" WHERE n2.nspname = 'pgagent' AND "
|
|
||||||
" c2.reltoastrelid != 0 AND "
|
|
||||||
" c3.reltoastidxid != 0 "
|
|
||||||
" ) " : "");
|
|
||||||
|
|
||||||
res = executeQueryOrDie(ctx, conn, query);
|
res = executeQueryOrDie(ctx, conn, query);
|
||||||
|
|
||||||
|
@ -196,10 +196,10 @@ prepare_new_databases(migratorContext *ctx)
|
|||||||
*/
|
*/
|
||||||
prep_status(ctx, "Creating databases in the new cluster");
|
prep_status(ctx, "Creating databases in the new cluster");
|
||||||
exec_prog(ctx, true,
|
exec_prog(ctx, true,
|
||||||
SYSTEMQUOTE "\"%s/%s\" --set ON_ERROR_STOP=on --port %d "
|
SYSTEMQUOTE "\"%s/psql\" --set ON_ERROR_STOP=on --port %d "
|
||||||
"-f \"%s/%s\" --dbname template1 >> \"%s\"" SYSTEMQUOTE,
|
"-f \"%s/%s\" --dbname template1 >> \"%s\"" SYSTEMQUOTE,
|
||||||
ctx->new.bindir, ctx->new.psql_exe, ctx->new.port,
|
ctx->new.bindir, ctx->new.port, ctx->output_dir,
|
||||||
ctx->output_dir, GLOBALS_DUMP_FILE, ctx->logfile);
|
GLOBALS_DUMP_FILE, ctx->logfile);
|
||||||
check_ok(ctx);
|
check_ok(ctx);
|
||||||
|
|
||||||
get_db_and_rel_infos(ctx, &ctx->new.dbarr, CLUSTER_NEW);
|
get_db_and_rel_infos(ctx, &ctx->new.dbarr, CLUSTER_NEW);
|
||||||
@ -218,10 +218,10 @@ create_new_objects(migratorContext *ctx)
|
|||||||
|
|
||||||
prep_status(ctx, "Restoring database schema to new cluster");
|
prep_status(ctx, "Restoring database schema to new cluster");
|
||||||
exec_prog(ctx, true,
|
exec_prog(ctx, true,
|
||||||
SYSTEMQUOTE "\"%s/%s\" --set ON_ERROR_STOP=on --port %d "
|
SYSTEMQUOTE "\"%s/psql\" --set ON_ERROR_STOP=on --port %d "
|
||||||
"-f \"%s/%s\" --dbname template1 >> \"%s\"" SYSTEMQUOTE,
|
"-f \"%s/%s\" --dbname template1 >> \"%s\"" SYSTEMQUOTE,
|
||||||
ctx->new.bindir, ctx->new.psql_exe, ctx->new.port,
|
ctx->new.bindir, ctx->new.port, ctx->output_dir,
|
||||||
ctx->output_dir, DB_DUMP_FILE, ctx->logfile);
|
DB_DUMP_FILE, ctx->logfile);
|
||||||
check_ok(ctx);
|
check_ok(ctx);
|
||||||
|
|
||||||
/* regenerate now that we have db schemas */
|
/* regenerate now that we have db schemas */
|
||||||
|
@ -200,15 +200,11 @@ typedef struct
|
|||||||
DbInfoArr dbarr; /* dbinfos array */
|
DbInfoArr dbarr; /* dbinfos array */
|
||||||
char *pgdata; /* pathname for cluster's $PGDATA directory */
|
char *pgdata; /* pathname for cluster's $PGDATA directory */
|
||||||
char *bindir; /* pathname for cluster's executable directory */
|
char *bindir; /* pathname for cluster's executable directory */
|
||||||
const char *psql_exe; /* name of the psql command to execute
|
|
||||||
* in the cluster */
|
|
||||||
unsigned short port; /* port number where postmaster is waiting */
|
unsigned short port; /* port number where postmaster is waiting */
|
||||||
uint32 major_version; /* PG_VERSION of cluster */
|
uint32 major_version; /* PG_VERSION of cluster */
|
||||||
char *major_version_str; /* string PG_VERSION of cluster */
|
char *major_version_str; /* string PG_VERSION of cluster */
|
||||||
Oid pg_database_oid; /* OID of pg_database relation */
|
Oid pg_database_oid; /* OID of pg_database relation */
|
||||||
char *libpath; /* pathname for cluster's pkglibdir */
|
char *libpath; /* pathname for cluster's pkglibdir */
|
||||||
/* EDB AS is PG 8.2 with 8.3 enhancements backpatched. */
|
|
||||||
bool is_edb_as; /* EnterpriseDB's Postgres Plus Advanced Server? */
|
|
||||||
char *tablespace_suffix; /* directory specification */
|
char *tablespace_suffix; /* directory specification */
|
||||||
} ClusterInfo;
|
} ClusterInfo;
|
||||||
|
|
||||||
|
@ -6,10 +6,6 @@
|
|||||||
|
|
||||||
#include "pg_upgrade.h"
|
#include "pg_upgrade.h"
|
||||||
|
|
||||||
#ifdef EDB_NATIVE_LANG
|
|
||||||
#include <fcntl.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "catalog/pg_class.h"
|
#include "catalog/pg_class.h"
|
||||||
#include "access/transam.h"
|
#include "access/transam.h"
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/pgupgrade.sgml,v 1.3 2010/05/13 15:03:24 momjian Exp $ -->
|
<!-- $PostgreSQL: pgsql/doc/src/sgml/pgupgrade.sgml,v 1.4 2010/05/13 22:51:00 momjian Exp $ -->
|
||||||
|
|
||||||
<sect1 id="pgupgrade">
|
<sect1 id="pgupgrade">
|
||||||
<title>pg_upgrade</title>
|
<title>pg_upgrade</title>
|
||||||
@ -23,11 +23,6 @@
|
|||||||
pg_upgrade supports upgrades from 8.3.X and later to the current
|
pg_upgrade supports upgrades from 8.3.X and later to the current
|
||||||
major release of Postgres, including snapshot and alpha releases.
|
major release of Postgres, including snapshot and alpha releases.
|
||||||
|
|
||||||
<!--
|
|
||||||
pg_upgrade also supports upgrades from EnterpriseDB's Postgres Plus
|
|
||||||
Advanced Server.
|
|
||||||
-->
|
|
||||||
|
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
</sect2>
|
</sect2>
|
||||||
@ -120,25 +115,6 @@ gmake prefix=/usr/local/pgsql.new install
|
|||||||
start the new cluster.
|
start the new cluster.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<!--
|
|
||||||
<para>
|
|
||||||
If migrating EnterpriseDB's Postgres Plus Advanced Server, you must:
|
|
||||||
<itemizedlist>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
<emphasis>not</> install <literal>sample tables and procedures/functions</>
|
|
||||||
in the new server
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
delete the empty <literal>edb</> schema in the <literal>enterprisedb</> database
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</itemizedlist>
|
|
||||||
</para>
|
|
||||||
-->
|
|
||||||
|
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user