diff options
Diffstat (limited to 'src/backend/utils')
-rw-r--r-- | src/backend/utils/adt/float.c | 36 | ||||
-rw-r--r-- | src/backend/utils/adt/oid.c | 17 |
2 files changed, 14 insertions, 39 deletions
diff --git a/src/backend/utils/adt/float.c b/src/backend/utils/adt/float.c index 4804445c32b..e51babfebfb 100644 --- a/src/backend/utils/adt/float.c +++ b/src/backend/utils/adt/float.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.112 2004/12/31 22:01:21 pgsql Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.113 2005/02/11 04:08:58 neilc Exp $ * *------------------------------------------------------------------------- */ @@ -267,21 +267,12 @@ float4in(PG_FUNCTION_ARGS) /* * Check for an empty-string input to begin with, to avoid the * vagaries of strtod() on different platforms. - * - * In releases prior to 8.0, we accepted an empty string as valid input - * (yielding a float4 of 0). In 8.0, we accept empty strings, but emit - * a warning noting that the feature is deprecated. In 8.1+, the - * warning should be replaced by an error. */ if (*num == '\0') - { - ereport(WARNING, - (errcode(ERRCODE_WARNING_DEPRECATED_FEATURE), - errmsg("deprecated input syntax for type real: \"\""), - errdetail("This input will be rejected in " - "a future release of PostgreSQL."))); - PG_RETURN_FLOAT4((float4) 0.0); - } + ereport(ERROR, + (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), + errmsg("invalid input syntax for type real: \"%s\"", + orig_num))); /* skip leading whitespace */ while (*num != '\0' && isspace((unsigned char) *num)) @@ -444,21 +435,12 @@ float8in(PG_FUNCTION_ARGS) /* * Check for an empty-string input to begin with, to avoid the * vagaries of strtod() on different platforms. - * - * In releases prior to 8.0, we accepted an empty string as valid input - * (yielding a float8 of 0). In 8.0, we accept empty strings, but emit - * a warning noting that the feature is deprecated. In 8.1+, the - * warning should be replaced by an error. */ if (*num == '\0') - { - ereport(WARNING, - (errcode(ERRCODE_WARNING_DEPRECATED_FEATURE), - errmsg("deprecated input syntax for type double precision: \"\""), - errdetail("This input will be rejected in " - "a future release of PostgreSQL."))); - PG_RETURN_FLOAT8(0.0); - } + ereport(ERROR, + (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), + errmsg("invalid input syntax for type double precision: \"%s\"", + orig_num))); /* skip leading whitespace */ while (*num != '\0' && isspace((unsigned char) *num)) diff --git a/src/backend/utils/adt/oid.c b/src/backend/utils/adt/oid.c index f499ae71b0c..ababe641b21 100644 --- a/src/backend/utils/adt/oid.c +++ b/src/backend/utils/adt/oid.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/adt/oid.c,v 1.60 2004/12/31 22:01:22 pgsql Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/oid.c,v 1.61 2005/02/11 04:08:58 neilc Exp $ * *------------------------------------------------------------------------- */ @@ -33,18 +33,11 @@ oidin_subr(const char *funcname, const char *s, char **endloc) char *endptr; Oid result; - /* - * In releases prior to 8.0, we accepted an empty string as valid - * input (yielding an OID of 0). In 8.0, we accept empty strings, but - * emit a warning noting that the feature is deprecated. In 8.1+, the - * warning should be replaced by an error. - */ if (*s == '\0') - ereport(WARNING, - (errcode(ERRCODE_WARNING_DEPRECATED_FEATURE), - errmsg("deprecated input syntax for type oid: \"\""), - errdetail("This input will be rejected in " - "a future release of PostgreSQL."))); + ereport(ERROR, + (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), + errmsg("invalid input syntax for type oid: \"%s\"", + s))); errno = 0; cvt = strtoul(s, &endptr, 10); |