Peter Eisentraut <[EMAIL PROTECTED]> writes:
> I believe I would have objected to an int/bool cast. I do so now
> anyway.

This was already discussed and agreed to.  Since it's an explicit-only
cast, I see no harm in it.  And it's certainly been requested often

> - Casting back and forth does not preserve information.  (This may be 
> true for some other type pairs as well, but in this case it's true in 
> almost every instance.)

On those grounds we should disallow most of the numeric-category casts.

> - It's an arbitary definition that is not obviously supported by 
> mathematical or similar principles.

Nonetheless, the convention 0=false, 1=true is widely recognized.

> - It opens the door for other silly casts like empty string => false, 
> non-empty string => true.

I haven't seen any requests for any such casts.  This cast is responding
to market demand, no more.

> - It's unnecessary because you can express the same thing using other 
> expressions that clearly state what they do.

Basically what this is for is building in a feature that people
otherwise build for themselves.  On the grounds of "it's unnecessary"
we could throw away large chunks of Postgres :-)

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [EMAIL PROTECTED] so that your
      message can get through to the mailing list cleanly

Reply via email to