CREATE OR REPLACE VIEW vmvtverif AS SELECT id,nb,oruuid,grp,own_src,own_dst,qtt,nat,created FROM tmvt where grp is not NULL UNION ALL SELECT id,nb,oruuid,grp,own_src,own_dst,qtt,nat,created FROM tmvtremoved where grp is not null; -------------------------------------------------------------------------------- CREATE OR REPLACE VIEW vorderverif AS SELECT id,uuid,own,nr,qtt_requ,np,qtt_prov,qtt,created FROM torder UNION SELECT id,uuid,own,nr,qtt_requ,np,qtt_prov,qtt,created FROM torderremoved; -------------------------------------------------------------------------------- CREATE OR REPLACE FUNCTION fgetstats(mini timestamp,maxi timestamp) RETURNS TABLE(_name text,cnt int8) AS $$ DECLARE _i int; _cnt int; BEGIN /* _name := 'number of qualities'; select count(*) INTO cnt FROM tquality where updated>=mini and updated=mini and created=mini and created=mini and removed=mini and updated=mini and deleted=mini and created=mini and created=mini and created