pgsql: Force the second argument of SUBSTRING(foo FOR bar) to be int4, - Mailing list pgsql-committers

From tgl@svr1.postgresql.org (Tom Lane)
Subject pgsql: Force the second argument of SUBSTRING(foo FOR bar) to be int4,
Date
Msg-id 20051113191146.2E13EDB5EB@svr1.postgresql.org
Whole thread Raw
List pgsql-committers
Log Message:
-----------
Force the second argument of SUBSTRING(foo FOR bar) to be int4, to avoid
surprising results when it's some other numeric type.  This doesn't solve
the generic problem of surprising implicit casts to text, but it's a
low-impact way of making sure this particular case behaves sanely.
Per gripe from Harald Fuchs and subsequent discussion.

Tags:
----
REL8_1_STABLE

Modified Files:
--------------
    pgsql/src/backend/parser:
        gram.y (r2.511 -> r2.511.2.1)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/gram.y.diff?r1=2.511&r2=2.511.2.1)

pgsql-committers by date:

Previous
From: tgl@svr1.postgresql.org (Tom Lane)
Date:
Subject: pgsql: Force the second argument of SUBSTRING(foo FOR bar) to be int4,
Next
From: tgl@svr1.postgresql.org (Tom Lane)
Date:
Subject: pgsql: Force the second argument of SUBSTRING(foo FOR bar) to be int4,