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

From: tgl(at)svr1(dot)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Force the second argument of SUBSTRING(foo FOR bar) to be int4,
Date: 2005-11-13 19:11:28
Message-ID: 20051113191128.0BCACDB5CD@svr1.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

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

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2005-11-13 19:11:46 pgsql: Force the second argument of SUBSTRING(foo FOR bar) to be int4,
Previous Message User Gsmet 2005-11-13 19:04:39 pgfouine - pgfouine: base error listeners