Re: Cast of numeric() - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Cast of numeric()
Date
Msg-id 200005151352.JAA16093@candle.pha.pa.us
Whole thread Raw
List pgsql-hackers
> > OK, this is making me rethink my suggestion in the book of using type()
> > to do typecasts.  Seems I should recommend CAST (val AS type), as wordy
> > as it is, or maybe val::type?
> 
> CAST(val AS type) is defined in SQL92. istm that the others are
> available at the whim of our current implementation, since when push
> comes to shove we might have to choose between having one of our
> non-standard mechanisms or having some other new features.

OK, I am going to use CAST everywhere, except in one place where I have
nested casts, which is just too hard to read, so I will use :: and
mention the CAST section.

> 
> An example is SQL3 enumerated types, which use the double-colon
> notation, but with value and type reversed from our syntax :(
> 
>                      - Thomas
> 
> -- 
> Thomas Lockhart                lockhart@alumni.caltech.edu
> South Pasadena, California
> 


--  Bruce Momjian                        |  http://www.op.net/~candle pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: AW: type conversion discussion
Next
From: Thomas Lockhart
Date:
Subject: Re: Proposal for fixing numeric type-resolution issues