Re: Weird type selection choice
От | Peter Eisentraut |
---|---|
Тема | Re: Weird type selection choice |
Дата | |
Msg-id | 200711071640.36561.peter_e@gmx.net обсуждение исходный текст |
Ответ на | Re: Weird type selection choice (Heikki Linnakangas <heikki@enterprisedb.com>) |
Ответы |
Re: Weird type selection choice
Re: Weird type selection choice |
Список | pgsql-hackers |
Am Mittwoch, 7. November 2007 schrieb Heikki Linnakangas: > Peter Eisentraut wrote: > > I wrote: > >> I noticed this problem in 8.2 and 8.3: > >> > >> pei=# select mod( trunc( 1 ), 2 ); > >> ERROR: 42883: function mod(double precision, integer) does not exist > >> LINE 1: select mod( trunc( 1 ), 2 ); > >> ^ > > > > I suppose there will be little interest in including the obvious > > solution, namely > > > > CREATE FUNCTION pg_catalog.trunc(int) RETURNS int AS $$ SELECT $1; $$ > > LANGUAGE SQL STRICT IMMUTABLE; > > It does sound totally useless... > > Why would you run a query like that in the first place? It seems like a > useless query as it is. Is there a bigger story behind it? The "1" is substituted from somewhere else. If the value happens to be, say, 1.5, it works, but not with 1 or 2. -- Peter Eisentraut http://developer.postgresql.org/~petere/
В списке pgsql-hackers по дате отправления: