Skip to content

Commit 36d3afd

Browse files
committed
Remove all mentions of EnterpriseDB Advanced Server from pg_upgrade;
EDB must maintain their own patch set for this.
1 parent 382ff21 commit 36d3afd

File tree

9 files changed

+20
-132
lines changed

9 files changed

+20
-132
lines changed

contrib/pg_upgrade/check.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,10 @@ issue_warnings(migratorContext *ctx, char *sequence_script_file_name)
149149
{
150150
prep_status(ctx, "Adjusting sequences");
151151
exec_prog(ctx, true,
152-
SYSTEMQUOTE "\"%s/%s\" --set ON_ERROR_STOP=on --port %d "
152+
SYSTEMQUOTE "\"%s/psql\" --set ON_ERROR_STOP=on --port %d "
153153
"-f \"%s\" --dbname template1 >> \"%s\"" SYSTEMQUOTE,
154-
ctx->new.bindir, ctx->new.psql_exe, ctx->new.port,
155-
sequence_script_file_name, ctx->logfile);
154+
ctx->new.bindir, ctx->new.port, sequence_script_file_name,
155+
ctx->logfile);
156156
unlink(sequence_script_file_name);
157157
pg_free(sequence_script_file_name);
158158
check_ok(ctx);

contrib/pg_upgrade/controldata.c

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99
#include <ctype.h>
1010
#include <stdlib.h>
1111

12-
#ifdef EDB_NATIVE_LANG
13-
#include "access/tuptoaster.h"
14-
#endif
15-
1612

1713
/*
1814
* get_control_data()
@@ -88,15 +84,6 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
8884
got_float8_pass_by_value = true;
8985
}
9086

91-
#ifdef EDB_NATIVE_LANG
92-
/* EDB AS 8.3 is an 8.2 code base */
93-
if (cluster->is_edb_as && GET_MAJOR_VERSION(cluster->major_version) <= 803)
94-
{
95-
cluster->controldata.toast = TOAST_MAX_CHUNK_SIZE;
96-
got_toast = true;
97-
}
98-
#endif
99-
10087
/* we have the result of cmd in "output". so parse it line by line now */
10188
while (fgets(bufin, sizeof(bufin), output))
10289
{
@@ -140,9 +127,7 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
140127
p++; /* removing ':' char */
141128
cluster->controldata.cat_ver = (uint32) atol(p);
142129
}
143-
else if ((p = strstr(bufin, "First log file ID after reset:")) != NULL ||
144-
(cluster->is_edb_as && GET_MAJOR_VERSION(cluster->major_version) <= 803 &&
145-
(p = strstr(bufin, "Current log file ID:")) != NULL))
130+
else if ((p = strstr(bufin, "First log file ID after reset:")) != NULL)
146131
{
147132
p = strchr(p, ':');
148133

@@ -153,9 +138,7 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
153138
cluster->controldata.logid = (uint32) atol(p);
154139
got_log_id = true;
155140
}
156-
else if ((p = strstr(bufin, "First log file segment after reset:")) != NULL ||
157-
(cluster->is_edb_as && GET_MAJOR_VERSION(cluster->major_version) <= 803 &&
158-
(p = strstr(bufin, "Next log file segment:")) != NULL))
141+
else if ((p = strstr(bufin, "First log file segment after reset:")) != NULL)
159142
{
160143
p = strchr(p, ':');
161144

contrib/pg_upgrade/exec.c

Lines changed: 7 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111

1212

1313
static void checkBinDir(migratorContext *ctx, ClusterInfo *cluster);
14-
static int check_exec(migratorContext *ctx, const char *dir, const char *cmdName,
15-
const char *alternative);
14+
static int check_exec(migratorContext *ctx, const char *dir, const char *cmdName);
1615
static const char *validate_exec(const char *path);
1716
static int check_data_dir(migratorContext *ctx, const char *pg_data);
1817

@@ -89,22 +88,10 @@ verify_directories(migratorContext *ctx)
8988
static void
9089
checkBinDir(migratorContext *ctx, ClusterInfo *cluster)
9190
{
92-
check_exec(ctx, cluster->bindir, "postgres", "edb-postgres");
93-
check_exec(ctx, cluster->bindir, "pg_ctl", NULL);
94-
check_exec(ctx, cluster->bindir, "pg_dumpall", NULL);
95-
96-
#ifdef EDB_NATIVE_LANG
97-
/* check for edb-psql first because we need to detect EDB AS */
98-
if (check_exec(ctx, cluster->bindir, "edb-psql", "psql") == 1)
99-
{
100-
cluster->psql_exe = "edb-psql";
101-
cluster->is_edb_as = true;
102-
}
103-
else
104-
#else
105-
if (check_exec(ctx, cluster->bindir, "psql", NULL) == 1)
106-
#endif
107-
cluster->psql_exe = "psql";
91+
check_exec(ctx, cluster->bindir, "postgres");
92+
check_exec(ctx, cluster->bindir, "psql");
93+
check_exec(ctx, cluster->bindir, "pg_ctl");
94+
check_exec(ctx, cluster->bindir, "pg_dumpall");
10895
}
10996

11097

@@ -146,30 +133,17 @@ is_server_running(migratorContext *ctx, const char *datadir)
146133
* a valid executable, this function returns 0 to indicated failure.
147134
*/
148135
static int
149-
check_exec(migratorContext *ctx, const char *dir, const char *cmdName,
150-
const char *alternative)
136+
check_exec(migratorContext *ctx, const char *dir, const char *cmdName)
151137
{
152138
char path[MAXPGPATH];
153139
const char *errMsg;
154140

155141
snprintf(path, sizeof(path), "%s%c%s", dir, pathSeparator, cmdName);
156142

157143
if ((errMsg = validate_exec(path)) == NULL)
158-
{
159144
return 1; /* 1 -> first alternative OK */
160-
}
161145
else
162-
{
163-
if (alternative)
164-
{
165-
report_status(ctx, PG_WARNING, "check for %s warning: %s",
166-
cmdName, errMsg);
167-
if (check_exec(ctx, dir, alternative, NULL) == 1)
168-
return 2; /* 2 -> second alternative OK */
169-
}
170-
else
171-
pg_log(ctx, PG_FATAL, "check for %s failed - %s\n", cmdName, errMsg);
172-
}
146+
pg_log(ctx, PG_FATAL, "check for %s failed - %s\n", cmdName, errMsg);
173147

174148
return 0; /* 0 -> neither alternative is acceptable */
175149
}

contrib/pg_upgrade/file.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99
#include <sys/types.h>
1010
#include <fcntl.h>
1111

12-
#ifdef EDB_NATIVE_LANG
13-
#include <fcntl.h>
14-
#endif
15-
1612
#ifdef WIN32
1713
#include <windows.h>
1814
#endif

contrib/pg_upgrade/info.c

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,6 @@ get_rel_infos(migratorContext *ctx, const DbInfo *dbinfo,
291291
RelInfoArr *relarr, Cluster whichCluster)
292292
{
293293
PGconn *conn = connectToServer(ctx, dbinfo->db_name, whichCluster);
294-
bool is_edb_as = (whichCluster == CLUSTER_OLD) ?
295-
ctx->old.is_edb_as : ctx->new.is_edb_as;
296294
PGresult *res;
297295
RelInfo *relinfos;
298296
int ntups;
@@ -341,38 +339,7 @@ get_rel_infos(migratorContext *ctx, const DbInfo *dbinfo,
341339
FirstNormalObjectId,
342340
/* see the comment at the top of v8_3_create_sequence_script() */
343341
(GET_MAJOR_VERSION(ctx->old.major_version) <= 803) ?
344-
"" : " OR relkind = 'S'",
345-
346-
/*
347-
* EDB AS installs pgagent by default via initdb. We have to ignore it,
348-
* and not migrate any old table contents.
349-
*/
350-
(is_edb_as && strcmp(dbinfo->db_name, "edb") == 0) ?
351-
" AND "
352-
" n.nspname != 'pgagent' AND "
353-
/* skip pgagent TOAST tables */
354-
" c.oid NOT IN "
355-
" ( "
356-
" SELECT c2.reltoastrelid "
357-
" FROM pg_catalog.pg_class c2 JOIN "
358-
" pg_catalog.pg_namespace n2 "
359-
" ON c2.relnamespace = n2.oid "
360-
" WHERE n2.nspname = 'pgagent' AND "
361-
" c2.reltoastrelid != 0 "
362-
" ) AND "
363-
/* skip pgagent TOAST table indexes */
364-
" c.oid NOT IN "
365-
" ( "
366-
" SELECT c3.reltoastidxid "
367-
" FROM pg_catalog.pg_class c2 JOIN "
368-
" pg_catalog.pg_namespace n2 "
369-
" ON c2.relnamespace = n2.oid JOIN "
370-
" pg_catalog.pg_class c3 "
371-
" ON c2.reltoastrelid = c3.oid "
372-
" WHERE n2.nspname = 'pgagent' AND "
373-
" c2.reltoastrelid != 0 AND "
374-
" c3.reltoastidxid != 0 "
375-
" ) " : "");
342+
"" : " OR relkind = 'S'");
376343

377344
res = executeQueryOrDie(ctx, conn, query);
378345

contrib/pg_upgrade/pg_upgrade.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,10 @@ prepare_new_databases(migratorContext *ctx)
196196
*/
197197
prep_status(ctx, "Creating databases in the new cluster");
198198
exec_prog(ctx, true,
199-
SYSTEMQUOTE "\"%s/%s\" --set ON_ERROR_STOP=on --port %d "
199+
SYSTEMQUOTE "\"%s/psql\" --set ON_ERROR_STOP=on --port %d "
200200
"-f \"%s/%s\" --dbname template1 >> \"%s\"" SYSTEMQUOTE,
201-
ctx->new.bindir, ctx->new.psql_exe, ctx->new.port,
202-
ctx->output_dir, GLOBALS_DUMP_FILE, ctx->logfile);
201+
ctx->new.bindir, ctx->new.port, ctx->output_dir,
202+
GLOBALS_DUMP_FILE, ctx->logfile);
203203
check_ok(ctx);
204204

205205
get_db_and_rel_infos(ctx, &ctx->new.dbarr, CLUSTER_NEW);
@@ -218,10 +218,10 @@ create_new_objects(migratorContext *ctx)
218218

219219
prep_status(ctx, "Restoring database schema to new cluster");
220220
exec_prog(ctx, true,
221-
SYSTEMQUOTE "\"%s/%s\" --set ON_ERROR_STOP=on --port %d "
221+
SYSTEMQUOTE "\"%s/psql\" --set ON_ERROR_STOP=on --port %d "
222222
"-f \"%s/%s\" --dbname template1 >> \"%s\"" SYSTEMQUOTE,
223-
ctx->new.bindir, ctx->new.psql_exe, ctx->new.port,
224-
ctx->output_dir, DB_DUMP_FILE, ctx->logfile);
223+
ctx->new.bindir, ctx->new.port, ctx->output_dir,
224+
DB_DUMP_FILE, ctx->logfile);
225225
check_ok(ctx);
226226

227227
/* regenerate now that we have db schemas */

contrib/pg_upgrade/pg_upgrade.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,15 +200,11 @@ typedef struct
200200
DbInfoArr dbarr; /* dbinfos array */
201201
char *pgdata; /* pathname for cluster's $PGDATA directory */
202202
char *bindir; /* pathname for cluster's executable directory */
203-
const char *psql_exe; /* name of the psql command to execute
204-
* in the cluster */
205203
unsigned short port; /* port number where postmaster is waiting */
206204
uint32 major_version; /* PG_VERSION of cluster */
207205
char *major_version_str; /* string PG_VERSION of cluster */
208206
Oid pg_database_oid; /* OID of pg_database relation */
209207
char *libpath; /* pathname for cluster's pkglibdir */
210-
/* EDB AS is PG 8.2 with 8.3 enhancements backpatched. */
211-
bool is_edb_as; /* EnterpriseDB's Postgres Plus Advanced Server? */
212208
char *tablespace_suffix; /* directory specification */
213209
} ClusterInfo;
214210

contrib/pg_upgrade/relfilenode.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66

77
#include "pg_upgrade.h"
88

9-
#ifdef EDB_NATIVE_LANG
10-
#include <fcntl.h>
11-
#endif
12-
139
#include "catalog/pg_class.h"
1410
#include "access/transam.h"
1511

doc/src/sgml/pgupgrade.sgml

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/pgupgrade.sgml,v 1.3 2010/05/13 15:03:24 momjian Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/pgupgrade.sgml,v 1.4 2010/05/13 22:51:00 momjian Exp $ -->
22

33
<sect1 id="pgupgrade">
44
<title>pg_upgrade</title>
@@ -23,11 +23,6 @@
2323
pg_upgrade supports upgrades from 8.3.X and later to the current
2424
major release of Postgres, including snapshot and alpha releases.
2525

26-
<!--
27-
pg_upgrade also supports upgrades from EnterpriseDB's Postgres Plus
28-
Advanced Server.
29-
-->
30-
3126
</para>
3227

3328
</sect2>
@@ -120,25 +115,6 @@ gmake prefix=/usr/local/pgsql.new install
120115
start the new cluster.
121116
</para>
122117

123-
<!--
124-
<para>
125-
If migrating EnterpriseDB's Postgres Plus Advanced Server, you must:
126-
<itemizedlist>
127-
<listitem>
128-
<para>
129-
<emphasis>not</> install <literal>sample tables and procedures/functions</>
130-
in the new server
131-
</para>
132-
</listitem>
133-
<listitem>
134-
<para>
135-
delete the empty <literal>edb</> schema in the <literal>enterprisedb</> database
136-
</para>
137-
</listitem>
138-
</itemizedlist>
139-
</para>
140-
-->
141-
142118
</listitem>
143119

144120
<listitem>

0 commit comments

Comments
 (0)