Re: [HACKERS] Unary % operator is broken in current sources

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [HACKERS] Unary % operator is broken in current sources
Дата
Msg-id 199903210225.VAA04636@candle.pha.pa.us
обсуждение исходный текст
Ответ на Unary % operator is broken in current sources  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [HACKERS] Unary % operator is broken in current sources  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
> These used to work:
> 
> regression=> select %f.f1   FROM FLOAT8_TBL f;
> ERROR:  parser: parse error at or near "%"
> regression=> select f.f1 %  FROM FLOAT8_TBL f;
> ERROR:  parser: parse error at or near "from"
> 
> This is causing the float8 regress test to fail.
> 
> I suspect this has to do with Bruce's recent hacking on operator
> associativity.

I see.  I see the same problem with / and +:test=> select %f.f1   FROM FLOAT8_TBL f;ERROR:  parser: parse error at or
near"%"test=> select /f.f1   FROM FLOAT8_TBL f;ERROR:  parser: parse error at or near "/"test=> select +f.f1   FROM
FLOAT8_TBLf;ERROR:  parser: parse error at or near "+"
 

\do % shows:
test=> \do %op|left_arg|right_arg|result |description        --+--------+---------+-------+-------------------% |
|float8   |float8 |truncate to integer% |float8  |         |float8 |truncate to integer% |int2    |int2     |int2
|modulus           % |int2    |int4     |int4   |modulus            % |int4    |int2     |int4   |modulus            %
|int4   |int4     |int4   |modulus            % |numeric |numeric  |numeric|modulus            (7 rows)
 

OK, I made the change.  It works now with special entries for %4 and 4%
in the grammer, similar to our handling of -4:regression=> select %f.f1   FROM FLOAT8_TBL f;?column?
---------------------0                   -34                  -1004                -1.2345678901234e+2000
    (5 rows)
 

--  Bruce Momjian                        |  http://www.op.net/~candle maillist@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 по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] 6.5 Features list
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Unary % operator is broken in current sources