Re: Cast of numeric()

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Cast of numeric()
Date: 2000-05-15 13:52:04
Message-ID: 200005151352.JAA16093@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)alumni(dot)caltech(dot)edu
> South Pasadena, California
>

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Lockhart 2000-05-15 13:56:00 Re: Cast of numeric()
Previous Message Alfred Perlstein 2000-05-11 19:22:13 Pgsql core contract?