Программа не учитывает custom aggregate functions  

  RSS

skoffer
Member
Joined: 2 years  ago
Posts: 5
2017-03-01 19:52  
CREATE AGGREGATE avg (float8)
(
    sfunc = float8_accum,
    stype = float8[],
    finalfunc = float8_avg,
    initcond = '{0,0,0}'
);

ReplyQuote
vvit1
DbpTeam
Joined: 3 years  ago
Posts: 20
2017-03-01 20:56  

Пока нет. Но можно создать POST_DEPLOY_SCRIPT  примерно такого содержания:

DO LANGUAGE plpgsql
$$
BEGIN

IF( NOT EXISTS (SELECT * FROM pg_proc where proname='avg' and proisagg='t')) THEN
	CREATE AGGREGATE avg (float8)
	(
	    sfunc = float8_accum,
	    stype = float8[],
	    finalfunc = float8_avg,
	    initcond = '{0,0,0}'
	);
END IF;

END;
$$;

 

Edited: 2 years  ago

skoffer liked
ReplyQuote
skoffer
Member
Joined: 2 years  ago
Posts: 5
2017-03-01 23:09  

спасибо!

 


ReplyQuote
  
Working

Please Login or Register