summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-01-19 19:04:40 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-01-19 19:04:40 +0000
commit9bd681a5220186230e0ea0f718a71af7ebe4b560 (patch)
tree3dddc229c62a5cc2b4da3ea50b2bc0b7256443d0 /src/backend/utils/adt
parent239760209b739d06e19ed4935776aeb89b6605f1 (diff)
downloadpostgresql-9bd681a5220186230e0ea0f718a71af7ebe4b560.tar.gz
Repair problem identified by Olivier Prenant: ALTER DATABASE SET search_path
should not be too eager to reject paths involving unknown schemas, since it can't really tell whether the schemas exist in the target database. (Also, when reading pg_dumpall output, it could be that the schemas don't exist yet, but eventually will.) ALTER USER SET has a similar issue. So, reduce the normal ERROR to a NOTICE when checking search_path values for these commands. Supporting this requires changing the API for GUC assign_hook functions, which causes the patch to touch a lot of places, but the changes are conceptually trivial.
Diffstat (limited to 'src/backend/utils/adt')
-rw-r--r--src/backend/utils/adt/datetime.c4
-rw-r--r--src/backend/utils/adt/pg_locale.c20
-rw-r--r--src/backend/utils/adt/regexp.c5
3 files changed, 15 insertions, 14 deletions
diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c
index 35ef845c5d..5fa4be73c4 100644
--- a/src/backend/utils/adt/datetime.c
+++ b/src/backend/utils/adt/datetime.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.123 2003/12/21 04:34:35 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.124 2004/01/19 19:04:40 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -3919,7 +3919,7 @@ EncodeInterval(struct tm * tm, fsec_t fsec, int style, char *str)
/* GUC assign_hook for australian_timezones */
bool
-ClearDateCache(bool newval, bool doit, bool interactive)
+ClearDateCache(bool newval, bool doit, GucSource source)
{
int i;
diff --git a/src/backend/utils/adt/pg_locale.c b/src/backend/utils/adt/pg_locale.c
index 15ae8ce953..5c2e951be1 100644
--- a/src/backend/utils/adt/pg_locale.c
+++ b/src/backend/utils/adt/pg_locale.c
@@ -4,7 +4,7 @@
*
* Portions Copyright (c) 2002-2003, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/backend/utils/adt/pg_locale.c,v 1.24 2003/11/29 19:51:59 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/pg_locale.c,v 1.25 2004/01/19 19:04:40 tgl Exp $
*
*-----------------------------------------------------------------------
*/
@@ -73,7 +73,7 @@ char *locale_time;
* valid. (See explanation at the top of this file.)
*/
static const char *
-locale_xxx_assign(int category, const char *value, bool doit, bool interactive)
+locale_xxx_assign(int category, const char *value, bool doit, GucSource source)
{
char *save;
@@ -99,21 +99,21 @@ locale_xxx_assign(int category, const char *value, bool doit, bool interactive)
const char *
-locale_monetary_assign(const char *value, bool doit, bool interactive)
+locale_monetary_assign(const char *value, bool doit, GucSource source)
{
- return locale_xxx_assign(LC_MONETARY, value, doit, interactive);
+ return locale_xxx_assign(LC_MONETARY, value, doit, source);
}
const char *
-locale_numeric_assign(const char *value, bool doit, bool interactive)
+locale_numeric_assign(const char *value, bool doit, GucSource source)
{
- return locale_xxx_assign(LC_NUMERIC, value, doit, interactive);
+ return locale_xxx_assign(LC_NUMERIC, value, doit, source);
}
const char *
-locale_time_assign(const char *value, bool doit, bool interactive)
+locale_time_assign(const char *value, bool doit, GucSource source)
{
- return locale_xxx_assign(LC_TIME, value, doit, interactive);
+ return locale_xxx_assign(LC_TIME, value, doit, source);
}
@@ -121,7 +121,7 @@ locale_time_assign(const char *value, bool doit, bool interactive)
* We allow LC_MESSAGES to actually be set globally.
*/
const char *
-locale_messages_assign(const char *value, bool doit, bool interactive)
+locale_messages_assign(const char *value, bool doit, GucSource source)
{
/*
* LC_MESSAGES category does not exist everywhere, but accept it
@@ -134,7 +134,7 @@ locale_messages_assign(const char *value, bool doit, bool interactive)
return NULL;
}
else
- value = locale_xxx_assign(LC_MESSAGES, value, false, interactive);
+ value = locale_xxx_assign(LC_MESSAGES, value, false, source);
#endif
return value;
}
diff --git a/src/backend/utils/adt/regexp.c b/src/backend/utils/adt/regexp.c
index 63b14266af..78944a5795 100644
--- a/src/backend/utils/adt/regexp.c
+++ b/src/backend/utils/adt/regexp.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/regexp.c,v 1.50 2003/11/29 19:51:59 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/regexp.c,v 1.51 2004/01/19 19:04:40 tgl Exp $
*
* Alistair Crooks added the code for the regex caching
* agc - cached the regular expressions used - there's a good chance
@@ -32,6 +32,7 @@
#include "regex/regex.h"
#include "mb/pg_wchar.h"
#include "utils/builtins.h"
+#include "utils/guc.h"
/* GUC-settable flavor parameter */
@@ -229,7 +230,7 @@ RE_compile_and_execute(text *text_re, unsigned char *dat, int dat_len,
*/
const char *
assign_regex_flavor(const char *value,
- bool doit, bool interactive)
+ bool doit, GucSource source)
{
if (strcasecmp(value, "advanced") == 0)
{