Обсуждение: Re: [QUESTIONS] Using % in a query

Поиск
Список
Период
Сортировка

Re: [QUESTIONS] Using % in a query

От
"Thomas G. Lockhart"
Дата:
> Gee, I saw I put the file on my postgresql account, but probably
> forgot to install it.  Sorry.  Would have been nice to get it into
> 6.3.1 too.

Well, I had mixed feelings about that anyway, since it hadn't been field
tested. I'll apply it along with the type conversion mods I'm working
on. btw, I already have working code for automatic conversions of
function arguments, moving on to operators next. Examples follow...

                        - Tom

-- this input is automatically converted to float8...
postgres=> select dsqrt(2);
          dsqrt
---------------
1.4142135623731
(1 row)

-- allow unknown types to convert to text type
-- this addresses the annoying MySQL context-free test cases
postgres=> select 'abc' || 'def';
--------
abcdef
(1 row)

-- this function is massively overloaded, but we automatically choose
-- the "datetime" type for evaluation...
postgres=> select date_part('year', 'now');
date_part
---------
     1998
(1 row)

Oh, I stumbled across a declaration problem in dpow() while testing :-/

Re: [QUESTIONS] Using % in a query

От
Bruce Momjian
Дата:
>
> > Gee, I saw I put the file on my postgresql account, but probably
> > forgot to install it.  Sorry.  Would have been nice to get it into
> > 6.3.1 too.
>
> Well, I had mixed feelings about that anyway, since it hadn't been field
> tested. I'll apply it along with the type conversion mods I'm working
> on. btw, I already have working code for automatic conversions of
> function arguments, moving on to operators next. Examples follow...
>
>                         - Tom
>
> -- this input is automatically converted to float8...
> postgres=> select dsqrt(2);
>           dsqrt
> ---------------
> 1.4142135623731
> (1 row)

This is great.  I had wanted to do this, but my head hurts every time I
study it.  Good job.

--
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)