|
12 | 12 | * by PostgreSQL
|
13 | 13 | *
|
14 | 14 | * IDENTIFICATION
|
15 |
| - * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.311 2002/12/12 21:03:24 tgl Exp $ |
| 15 | + * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.312 2002/12/21 22:45:09 tgl Exp $ |
16 | 16 | *
|
17 | 17 | *-------------------------------------------------------------------------
|
18 | 18 | */
|
@@ -762,7 +762,8 @@ selectDumpableNamespace(NamespaceInfo *nsinfo)
|
762 | 762 | */
|
763 | 763 | if (selectTablename != NULL)
|
764 | 764 | nsinfo->dump = false;
|
765 |
| - else if (strncmp(nsinfo->nspname, "pg_", 3) == 0) |
| 765 | + else if (strncmp(nsinfo->nspname, "pg_", 3) == 0 || |
| 766 | + strcmp(nsinfo->nspname, "information_schema") == 0) |
766 | 767 | nsinfo->dump = false;
|
767 | 768 | else
|
768 | 769 | nsinfo->dump = true;
|
@@ -1219,7 +1220,8 @@ dumpDatabase(Archive *AH)
|
1219 | 1220 |
|
1220 | 1221 | /* Get the database owner and parameters from pg_database */
|
1221 | 1222 | appendPQExpBuffer(dbQry, "select (select usename from pg_user where usesysid = datdba) as dba,"
|
1222 |
| - " encoding, datpath from pg_database" |
| 1223 | + " pg_encoding_to_char(encoding) as encoding," |
| 1224 | + " datpath from pg_database" |
1223 | 1225 | " where datname = ");
|
1224 | 1226 | appendStringLiteral(dbQry, datname, true);
|
1225 | 1227 |
|
@@ -1258,10 +1260,16 @@ dumpDatabase(Archive *AH)
|
1258 | 1260 |
|
1259 | 1261 | appendPQExpBuffer(creaQry, "CREATE DATABASE %s WITH TEMPLATE = template0",
|
1260 | 1262 | fmtId(datname));
|
1261 |
| - if (strlen(encoding) > 0) |
1262 |
| - appendPQExpBuffer(creaQry, " ENCODING = %s", encoding); |
1263 | 1263 | if (strlen(datpath) > 0)
|
1264 |
| - appendPQExpBuffer(creaQry, " LOCATION = '%s'", datpath); |
| 1264 | + { |
| 1265 | + appendPQExpBuffer(creaQry, " LOCATION = "); |
| 1266 | + appendStringLiteral(creaQry, datpath, true); |
| 1267 | + } |
| 1268 | + if (strlen(encoding) > 0) |
| 1269 | + { |
| 1270 | + appendPQExpBuffer(creaQry, " ENCODING = "); |
| 1271 | + appendStringLiteral(creaQry, encoding, true); |
| 1272 | + } |
1265 | 1273 | appendPQExpBuffer(creaQry, ";\n");
|
1266 | 1274 |
|
1267 | 1275 | appendPQExpBuffer(delQry, "DROP DATABASE %s;\n",
|
|
0 commit comments