On Tue, Sep 01, 2009 at 05:49:25PM +0100, Sam Mason wrote:
> PG could maybe throw an error to tell you this is
> what is happening?
Would something like the included patch be accepted?
--
Sam http://samason.me.uk/
*** src/backend/utils/adt/char.c~ 2009-01-01 17:23:49.000000000 +0000
--- src/backend/utils/adt/char.c 2009-09-02 10:11:13.000000000 +0100
***************
*** 34,39 ****
--- 34,45 ----
{
char *ch = PG_GETARG_CSTRING(0);
+ if (ch[1])
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
+ errmsg("only a single character is supported in \"char\" literals: \"%s\"",
+ ch)));
+
PG_RETURN_CHAR(ch[0]);
}
--
Sent via pgsql-bugs mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs