Re: [HACKERS] I think we need an explicit parsetree node for CAST - Mailing list pgsql-hackers

From Don Baccus
Subject Re: [HACKERS] I think we need an explicit parsetree node for CAST
Date
Msg-id 3.0.1.32.20000115200730.010ac290@mail.pacifier.com
Whole thread Raw
In response to I think we need an explicit parsetree node for CAST  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
At 09:03 PM 1/15/00 -0500, Tom Lane wrote:

>What I think we need is to add a new parsetree node type that explicitly
>represents a CAST operator, and then modify parse_expr.c to transform
>that node type into an appropriate function call (or, perhaps, nothing
>at all if the source value is already the right type).
>
>Comments?

Well, I hate to keep popping up wearing my compiler-writer hat, but
yes, this seems obvious.   If the casting notation includes type
modifications like precision information then the simple expression
type_name(expr) can't ever match it.  The casting notation must be 
rejected or properly executed.  Silent errors of this type are simply
unforgivable.  Either an error or a proper transformation (presumably
to a function that takes precision and scale parameters) is fine, but
silent and incorrect execution is a major sin.



- Don Baccus, Portland OR <dhogaza@pacifier.com> Nature photos, on-line guides, Pacific Northwest Rare Bird Alert
Serviceand other goodies at http://donb.photo.net.
 


pgsql-hackers by date:

Previous
From: "Adrian Pach"
Date:
Subject: Credit Card ???????????
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] pg_dump not in very good shape