On Wednesday 27 November 2002 06:23, Tom Lane wrote:
(B> Ian Barwick <[EMAIL PROTECTED]> writes:
(B> > in 7.3 the following no longer works:
(B> >   template1=> select 0::bool;
(B> >   ERROR:  Cannot cast type integer to boolean
(B>
(B> Note that both old and new versions reject
(B>       select 0::int4::bool;
(B>
(B> I believe the behavioral change is a consequence of Rod Taylor's
(B> DOMAIN patch: it essentially eliminated the old parser_typecast_constant()
(B> routine in order to ensure that constraints associated with a domain
(B> would get applied in examples like "select 0::domaintypename".
(B>
(B> I wasn't totally happy with Rod's patch, for reasons that I couldn't put
(B> my finger on at the time, but perhaps my hindbrain understood that there
(B> would be noticeable behavioral changes.  But be that as it may, the code
(B> is in there now and is unlikely to get reverted.  There isn't any place
(B> in our docs that promises that you can coerce an integer-looking literal
(B> to bool --- and one could argue that allowing such is just opening the
(B> door for typos.
(B
(BThanks for the explanation. I'm not screaming for a reversion ;-), but 
(Bchanging behaviour which was implicitly valid in previous
(Bversions is bound to cause a few people a little head scratching
(Bwhen converting applications to 7.3 (I'm sure I can't be the only one).
(B
(BHow about a line in HISTORY under "Migration to version 7.3" along
(Bthe lines of:
(B
(B"Casting integers to boolean (for example, 0::bool) is no longer allowed,
(Buse '0'::bool instead".
(B
(B
(BIan Barwick
([EMAIL PROTECTED]
(B
(B
(B---------------------------(end of broadcast)---------------------------
(BTIP 5: Have you checked our extensive FAQ?
(B
(Bhttp://www.postgresql.org/users-lounge/docs/faq.html


Reply via email to