upgrade base PostgreSQL v8.3.7->8.3.8

This commit is contained in:
KaiGai Kohei 2009-09-10 12:27:20 +00:00
commit c3eae44511
7 changed files with 1761 additions and 1229 deletions

View file

@ -1,6 +1,6 @@
diff -rpNU3 base/src/bin/initdb/initdb.c sepgsql-new/src/bin/initdb/initdb.c
--- base/src/bin/initdb/initdb.c 2008-11-05 09:57:00.000000000 +0900
+++ sepgsql-new/src/bin/initdb/initdb.c 2009-03-13 18:14:33.000000000 +0900
--- base/src/bin/initdb/initdb.c 2009-09-10 20:11:35.000000000 +0900
+++ sepgsql-new/src/bin/initdb/initdb.c 2009-09-10 20:24:37.000000000 +0900
@@ -94,6 +94,7 @@ static bool debug = false;
static bool noclean = false;
static bool show_setting = false;
@ -9,7 +9,7 @@ diff -rpNU3 base/src/bin/initdb/initdb.c sepgsql-new/src/bin/initdb/initdb.c
/* internal vars */
@@ -1212,6 +1213,13 @@ setup_config(void)
@@ -1224,6 +1225,13 @@ setup_config(void)
"#default_text_search_config = 'pg_catalog.simple'",
repltok);
@ -23,7 +23,7 @@ diff -rpNU3 base/src/bin/initdb/initdb.c sepgsql-new/src/bin/initdb/initdb.c
snprintf(path, sizeof(path), "%s/postgresql.conf", pg_data);
writefile(path, conflines);
@@ -2383,6 +2391,7 @@ usage(const char *progname)
@@ -2395,6 +2403,7 @@ usage(const char *progname)
printf(_(" -U, --username=NAME database superuser name\n"));
printf(_(" -W, --pwprompt prompt for a password for the new superuser\n"));
printf(_(" --pwfile=FILE read password for the new superuser from file\n"));
@ -31,7 +31,7 @@ diff -rpNU3 base/src/bin/initdb/initdb.c sepgsql-new/src/bin/initdb/initdb.c
printf(_(" -?, --help show this help, then exit\n"));
printf(_(" -V, --version output version information, then exit\n"));
printf(_("\nLess commonly used options:\n"));
@@ -2417,6 +2426,7 @@ main(int argc, char *argv[])
@@ -2429,6 +2438,7 @@ main(int argc, char *argv[])
{"auth", required_argument, NULL, 'A'},
{"pwprompt", no_argument, NULL, 'W'},
{"pwfile", required_argument, NULL, 9},
@ -39,7 +39,7 @@ diff -rpNU3 base/src/bin/initdb/initdb.c sepgsql-new/src/bin/initdb/initdb.c
{"username", required_argument, NULL, 'U'},
{"help", no_argument, NULL, '?'},
{"version", no_argument, NULL, 'V'},
@@ -2531,6 +2541,9 @@ main(int argc, char *argv[])
@@ -2543,6 +2553,9 @@ main(int argc, char *argv[])
case 9:
pwfilename = xstrdup(optarg);
break;
@ -50,8 +50,8 @@ diff -rpNU3 base/src/bin/initdb/initdb.c sepgsql-new/src/bin/initdb/initdb.c
show_setting = true;
break;
diff -rpNU3 base/src/bin/pg_dump/pg_dump.c sepgsql-new/src/bin/pg_dump/pg_dump.c
--- base/src/bin/pg_dump/pg_dump.c 2009-02-02 11:47:17.000000000 +0900
+++ sepgsql-new/src/bin/pg_dump/pg_dump.c 2009-03-13 18:14:33.000000000 +0900
--- base/src/bin/pg_dump/pg_dump.c 2009-09-10 20:11:35.000000000 +0900
+++ sepgsql-new/src/bin/pg_dump/pg_dump.c 2009-09-10 20:24:37.000000000 +0900
@@ -118,6 +118,8 @@ static int g_numNamespaces;
/* flag to turn on/off dollar quoting */
static int disable_dollar_quoting = 0;
@ -121,7 +121,7 @@ diff -rpNU3 base/src/bin/pg_dump/pg_dump.c sepgsql-new/src/bin/pg_dump/pg_dump.c
fmtQualifiedId(tbinfo->dobj.namespace->dobj.name,
classname));
}
@@ -1785,11 +1810,29 @@ dumpBlobComments(Archive *AH, void *arg)
@@ -1791,11 +1816,29 @@ dumpBlobComments(Archive *AH, void *arg)
Oid blobOid;
char *comment;
@ -152,7 +152,7 @@ diff -rpNU3 base/src/bin/pg_dump/pg_dump.c sepgsql-new/src/bin/pg_dump/pg_dump.c
comment = PQgetvalue(res, i, 1);
printfPQExpBuffer(commentcmd, "COMMENT ON LARGE OBJECT %u IS ",
@@ -2887,6 +2930,7 @@ getTables(int *numTables)
@@ -2893,6 +2936,7 @@ getTables(int *numTables)
int i_owning_col;
int i_reltablespace;
int i_reloptions;
@ -160,7 +160,7 @@ diff -rpNU3 base/src/bin/pg_dump/pg_dump.c sepgsql-new/src/bin/pg_dump/pg_dump.c
/* Make sure we are in proper schema */
selectSourceSchema("pg_catalog");
@@ -2926,7 +2970,8 @@ getTables(int *numTables)
@@ -2932,7 +2976,8 @@ getTables(int *numTables)
"d.refobjid as owning_tab, "
"d.refobjsubid as owning_col, "
"(SELECT spcname FROM pg_tablespace t WHERE t.oid = c.reltablespace) AS reltablespace, "
@ -170,7 +170,7 @@ diff -rpNU3 base/src/bin/pg_dump/pg_dump.c sepgsql-new/src/bin/pg_dump/pg_dump.c
"from pg_class c "
"left join pg_depend d on "
"(c.relkind = '%c' and "
@@ -2936,6 +2981,7 @@ getTables(int *numTables)
@@ -2942,6 +2987,7 @@ getTables(int *numTables)
"where relkind in ('%c', '%c', '%c', '%c') "
"order by c.oid",
username_subquery,
@ -178,7 +178,7 @@ diff -rpNU3 base/src/bin/pg_dump/pg_dump.c sepgsql-new/src/bin/pg_dump/pg_dump.c
RELKIND_SEQUENCE,
RELKIND_RELATION, RELKIND_SEQUENCE,
RELKIND_VIEW, RELKIND_COMPOSITE_TYPE);
@@ -2955,7 +3001,8 @@ getTables(int *numTables)
@@ -2961,7 +3007,8 @@ getTables(int *numTables)
"d.refobjid as owning_tab, "
"d.refobjsubid as owning_col, "
"(SELECT spcname FROM pg_tablespace t WHERE t.oid = c.reltablespace) AS reltablespace, "
@ -188,7 +188,7 @@ diff -rpNU3 base/src/bin/pg_dump/pg_dump.c sepgsql-new/src/bin/pg_dump/pg_dump.c
"from pg_class c "
"left join pg_depend d on "
"(c.relkind = '%c' and "
@@ -2984,7 +3031,8 @@ getTables(int *numTables)
@@ -2990,7 +3037,8 @@ getTables(int *numTables)
"d.refobjid as owning_tab, "
"d.refobjsubid as owning_col, "
"NULL as reltablespace, "
@ -198,7 +198,7 @@ diff -rpNU3 base/src/bin/pg_dump/pg_dump.c sepgsql-new/src/bin/pg_dump/pg_dump.c
"from pg_class c "
"left join pg_depend d on "
"(c.relkind = '%c' and "
@@ -3009,7 +3057,8 @@ getTables(int *numTables)
@@ -3015,7 +3063,8 @@ getTables(int *numTables)
"NULL::oid as owning_tab, "
"NULL::int4 as owning_col, "
"NULL as reltablespace, "
@ -208,7 +208,7 @@ diff -rpNU3 base/src/bin/pg_dump/pg_dump.c sepgsql-new/src/bin/pg_dump/pg_dump.c
"from pg_class "
"where relkind in ('%c', '%c', '%c') "
"order by oid",
@@ -3029,7 +3078,8 @@ getTables(int *numTables)
@@ -3035,7 +3084,8 @@ getTables(int *numTables)
"NULL::oid as owning_tab, "
"NULL::int4 as owning_col, "
"NULL as reltablespace, "
@ -218,7 +218,7 @@ diff -rpNU3 base/src/bin/pg_dump/pg_dump.c sepgsql-new/src/bin/pg_dump/pg_dump.c
"from pg_class "
"where relkind in ('%c', '%c', '%c') "
"order by oid",
@@ -3059,7 +3109,8 @@ getTables(int *numTables)
@@ -3065,7 +3115,8 @@ getTables(int *numTables)
"NULL::oid as owning_tab, "
"NULL::int4 as owning_col, "
"NULL as reltablespace, "
@ -228,7 +228,7 @@ diff -rpNU3 base/src/bin/pg_dump/pg_dump.c sepgsql-new/src/bin/pg_dump/pg_dump.c
"from pg_class c "
"where relkind in ('%c', '%c') "
"order by oid",
@@ -3102,6 +3153,7 @@ getTables(int *numTables)
@@ -3108,6 +3159,7 @@ getTables(int *numTables)
i_owning_col = PQfnumber(res, "owning_col");
i_reltablespace = PQfnumber(res, "reltablespace");
i_reloptions = PQfnumber(res, "reloptions");
@ -236,7 +236,7 @@ diff -rpNU3 base/src/bin/pg_dump/pg_dump.c sepgsql-new/src/bin/pg_dump/pg_dump.c
for (i = 0; i < ntups; i++)
{
@@ -3132,6 +3184,7 @@ getTables(int *numTables)
@@ -3138,6 +3190,7 @@ getTables(int *numTables)
}
tblinfo[i].reltablespace = strdup(PQgetvalue(res, i, i_reltablespace));
tblinfo[i].reloptions = strdup(PQgetvalue(res, i, i_reloptions));
@ -244,7 +244,7 @@ diff -rpNU3 base/src/bin/pg_dump/pg_dump.c sepgsql-new/src/bin/pg_dump/pg_dump.c
/* other fields were zeroed above */
@@ -4320,6 +4373,7 @@ getTableAttrs(TableInfo *tblinfo, int nu
@@ -4326,6 +4379,7 @@ getTableAttrs(TableInfo *tblinfo, int nu
int i_atthasdef;
int i_attisdropped;
int i_attislocal;
@ -252,7 +252,7 @@ diff -rpNU3 base/src/bin/pg_dump/pg_dump.c sepgsql-new/src/bin/pg_dump/pg_dump.c
PGresult *res;
int ntups;
bool hasdefaults;
@@ -4362,12 +4416,14 @@ getTableAttrs(TableInfo *tblinfo, int nu
@@ -4368,12 +4422,14 @@ getTableAttrs(TableInfo *tblinfo, int nu
/* need left join here to not fail on dropped columns ... */
appendPQExpBuffer(q, "SELECT a.attnum, a.attname, a.atttypmod, a.attstattarget, a.attstorage, t.typstorage, "
"a.attnotnull, a.atthasdef, a.attisdropped, a.attislocal, "
@ -268,7 +268,7 @@ diff -rpNU3 base/src/bin/pg_dump/pg_dump.c sepgsql-new/src/bin/pg_dump/pg_dump.c
tbinfo->dobj.catId.oid);
}
else if (g_fout->remoteVersion >= 70100)
@@ -4379,7 +4435,8 @@ getTableAttrs(TableInfo *tblinfo, int nu
@@ -4385,7 +4441,8 @@ getTableAttrs(TableInfo *tblinfo, int nu
*/
appendPQExpBuffer(q, "SELECT a.attnum, a.attname, a.atttypmod, -1 as attstattarget, a.attstorage, t.typstorage, "
"a.attnotnull, a.atthasdef, false as attisdropped, false as attislocal, "
@ -278,7 +278,7 @@ diff -rpNU3 base/src/bin/pg_dump/pg_dump.c sepgsql-new/src/bin/pg_dump/pg_dump.c
"from pg_attribute a left join pg_type t "
"on a.atttypid = t.oid "
"where a.attrelid = '%u'::oid "
@@ -4392,7 +4449,8 @@ getTableAttrs(TableInfo *tblinfo, int nu
@@ -4398,7 +4455,8 @@ getTableAttrs(TableInfo *tblinfo, int nu
/* format_type not available before 7.1 */
appendPQExpBuffer(q, "SELECT attnum, attname, atttypmod, -1 as attstattarget, attstorage, attstorage as typstorage, "
"attnotnull, atthasdef, false as attisdropped, false as attislocal, "
@ -288,7 +288,7 @@ diff -rpNU3 base/src/bin/pg_dump/pg_dump.c sepgsql-new/src/bin/pg_dump/pg_dump.c
"from pg_attribute a "
"where attrelid = '%u'::oid "
"and attnum > 0::int2 "
@@ -4416,6 +4474,7 @@ getTableAttrs(TableInfo *tblinfo, int nu
@@ -4422,6 +4480,7 @@ getTableAttrs(TableInfo *tblinfo, int nu
i_atthasdef = PQfnumber(res, "atthasdef");
i_attisdropped = PQfnumber(res, "attisdropped");
i_attislocal = PQfnumber(res, "attislocal");
@ -296,7 +296,7 @@ diff -rpNU3 base/src/bin/pg_dump/pg_dump.c sepgsql-new/src/bin/pg_dump/pg_dump.c
tbinfo->numatts = ntups;
tbinfo->attnames = (char **) malloc(ntups * sizeof(char *));
@@ -4426,6 +4485,7 @@ getTableAttrs(TableInfo *tblinfo, int nu
@@ -4432,6 +4491,7 @@ getTableAttrs(TableInfo *tblinfo, int nu
tbinfo->typstorage = (char *) malloc(ntups * sizeof(char));
tbinfo->attisdropped = (bool *) malloc(ntups * sizeof(bool));
tbinfo->attislocal = (bool *) malloc(ntups * sizeof(bool));
@ -304,7 +304,7 @@ diff -rpNU3 base/src/bin/pg_dump/pg_dump.c sepgsql-new/src/bin/pg_dump/pg_dump.c
tbinfo->notnull = (bool *) malloc(ntups * sizeof(bool));
tbinfo->attrdefs = (AttrDefInfo **) malloc(ntups * sizeof(AttrDefInfo *));
tbinfo->inhAttrs = (bool *) malloc(ntups * sizeof(bool));
@@ -4449,6 +4509,7 @@ getTableAttrs(TableInfo *tblinfo, int nu
@@ -4455,6 +4515,7 @@ getTableAttrs(TableInfo *tblinfo, int nu
tbinfo->typstorage[j] = *(PQgetvalue(res, j, i_typstorage));
tbinfo->attisdropped[j] = (PQgetvalue(res, j, i_attisdropped)[0] == 't');
tbinfo->attislocal[j] = (PQgetvalue(res, j, i_attislocal)[0] == 't');
@ -312,7 +312,7 @@ diff -rpNU3 base/src/bin/pg_dump/pg_dump.c sepgsql-new/src/bin/pg_dump/pg_dump.c
tbinfo->notnull[j] = (PQgetvalue(res, j, i_attnotnull)[0] == 't');
tbinfo->attrdefs[j] = NULL; /* fix below */
if (PQgetvalue(res, j, i_atthasdef)[0] == 't')
@@ -6430,6 +6491,7 @@ dumpFunc(Archive *fout, FuncInfo *finfo)
@@ -6436,6 +6497,7 @@ dumpFunc(Archive *fout, FuncInfo *finfo)
char *procost;
char *prorows;
char *lanname;
@ -320,7 +320,7 @@ diff -rpNU3 base/src/bin/pg_dump/pg_dump.c sepgsql-new/src/bin/pg_dump/pg_dump.c
char *rettypename;
int nallargs;
char **allargtypes = NULL;
@@ -6459,9 +6521,11 @@ dumpFunc(Archive *fout, FuncInfo *finfo)
@@ -6465,9 +6527,11 @@ dumpFunc(Archive *fout, FuncInfo *finfo)
"proallargtypes, proargmodes, proargnames, "
"provolatile, proisstrict, prosecdef, "
"proconfig, procost, prorows, "
@ -333,7 +333,7 @@ diff -rpNU3 base/src/bin/pg_dump/pg_dump.c sepgsql-new/src/bin/pg_dump/pg_dump.c
finfo->dobj.catId.oid);
}
else if (g_fout->remoteVersion >= 80100)
@@ -6471,7 +6535,8 @@ dumpFunc(Archive *fout, FuncInfo *finfo)
@@ -6477,7 +6541,8 @@ dumpFunc(Archive *fout, FuncInfo *finfo)
"proallargtypes, proargmodes, proargnames, "
"provolatile, proisstrict, prosecdef, "
"null as proconfig, 0 as procost, 0 as prorows, "
@ -343,7 +343,7 @@ diff -rpNU3 base/src/bin/pg_dump/pg_dump.c sepgsql-new/src/bin/pg_dump/pg_dump.c
"FROM pg_catalog.pg_proc "
"WHERE oid = '%u'::pg_catalog.oid",
finfo->dobj.catId.oid);
@@ -6485,7 +6550,8 @@ dumpFunc(Archive *fout, FuncInfo *finfo)
@@ -6491,7 +6556,8 @@ dumpFunc(Archive *fout, FuncInfo *finfo)
"proargnames, "
"provolatile, proisstrict, prosecdef, "
"null as proconfig, 0 as procost, 0 as prorows, "
@ -353,7 +353,7 @@ diff -rpNU3 base/src/bin/pg_dump/pg_dump.c sepgsql-new/src/bin/pg_dump/pg_dump.c
"FROM pg_catalog.pg_proc "
"WHERE oid = '%u'::pg_catalog.oid",
finfo->dobj.catId.oid);
@@ -6499,7 +6565,8 @@ dumpFunc(Archive *fout, FuncInfo *finfo)
@@ -6505,7 +6571,8 @@ dumpFunc(Archive *fout, FuncInfo *finfo)
"null as proargnames, "
"provolatile, proisstrict, prosecdef, "
"null as proconfig, 0 as procost, 0 as prorows, "
@ -363,7 +363,7 @@ diff -rpNU3 base/src/bin/pg_dump/pg_dump.c sepgsql-new/src/bin/pg_dump/pg_dump.c
"FROM pg_catalog.pg_proc "
"WHERE oid = '%u'::pg_catalog.oid",
finfo->dobj.catId.oid);
@@ -6515,7 +6582,8 @@ dumpFunc(Archive *fout, FuncInfo *finfo)
@@ -6521,7 +6588,8 @@ dumpFunc(Archive *fout, FuncInfo *finfo)
"proisstrict, "
"'f'::boolean as prosecdef, "
"null as proconfig, 0 as procost, 0 as prorows, "
@ -373,7 +373,7 @@ diff -rpNU3 base/src/bin/pg_dump/pg_dump.c sepgsql-new/src/bin/pg_dump/pg_dump.c
"FROM pg_proc "
"WHERE oid = '%u'::oid",
finfo->dobj.catId.oid);
@@ -6531,7 +6599,8 @@ dumpFunc(Archive *fout, FuncInfo *finfo)
@@ -6537,7 +6605,8 @@ dumpFunc(Archive *fout, FuncInfo *finfo)
"'f'::boolean as proisstrict, "
"'f'::boolean as prosecdef, "
"null as proconfig, 0 as procost, 0 as prorows, "
@ -383,7 +383,7 @@ diff -rpNU3 base/src/bin/pg_dump/pg_dump.c sepgsql-new/src/bin/pg_dump/pg_dump.c
"FROM pg_proc "
"WHERE oid = '%u'::oid",
finfo->dobj.catId.oid);
@@ -6562,6 +6631,7 @@ dumpFunc(Archive *fout, FuncInfo *finfo)
@@ -6568,6 +6637,7 @@ dumpFunc(Archive *fout, FuncInfo *finfo)
procost = PQgetvalue(res, 0, PQfnumber(res, "procost"));
prorows = PQgetvalue(res, 0, PQfnumber(res, "prorows"));
lanname = PQgetvalue(res, 0, PQfnumber(res, "lanname"));
@ -391,7 +391,7 @@ diff -rpNU3 base/src/bin/pg_dump/pg_dump.c sepgsql-new/src/bin/pg_dump/pg_dump.c
/*
* See backend/commands/define.c for details of how the 'AS' clause is
@@ -6699,6 +6769,9 @@ dumpFunc(Archive *fout, FuncInfo *finfo)
@@ -6705,6 +6775,9 @@ dumpFunc(Archive *fout, FuncInfo *finfo)
if (prosecdef[0] == 't')
appendPQExpBuffer(q, " SECURITY DEFINER");
@ -401,7 +401,7 @@ diff -rpNU3 base/src/bin/pg_dump/pg_dump.c sepgsql-new/src/bin/pg_dump/pg_dump.c
/*
* COST and ROWS are emitted only if present and not default, so as not to
* break backwards-compatibility of the dump without need. Keep this code
@@ -8780,6 +8853,10 @@ dumpTableSchema(Archive *fout, TableInfo
@@ -8786,6 +8859,10 @@ dumpTableSchema(Archive *fout, TableInfo
if (tbinfo->notnull[j] && !tbinfo->inhNotNull[j])
appendPQExpBuffer(q, " NOT NULL");
@ -412,7 +412,7 @@ diff -rpNU3 base/src/bin/pg_dump/pg_dump.c sepgsql-new/src/bin/pg_dump/pg_dump.c
actual_atts++;
}
}
@@ -8827,6 +8904,9 @@ dumpTableSchema(Archive *fout, TableInfo
@@ -8833,6 +8910,9 @@ dumpTableSchema(Archive *fout, TableInfo
if (tbinfo->reloptions && strlen(tbinfo->reloptions) > 0)
appendPQExpBuffer(q, "\nWITH (%s)", tbinfo->reloptions);
@ -422,7 +422,7 @@ diff -rpNU3 base/src/bin/pg_dump/pg_dump.c sepgsql-new/src/bin/pg_dump/pg_dump.c
appendPQExpBuffer(q, ";\n");
/* Loop dumping statistics and storage statements */
@@ -10244,6 +10324,13 @@ fmtCopyColumnList(const TableInfo *ti)
@@ -10250,6 +10330,13 @@ fmtCopyColumnList(const TableInfo *ti)
appendPQExpBuffer(q, "(");
needComma = false;