Q:

Select with "Ratio_to_report" on table

i want to select the ration of the total price or the id_programme made by id_lot :
here is the table : 
 id_lot | id_programme | surface | prix 
--------+--------------+---------+------
    101 |            1 |      30 |  180
    201 |            1 |      30 |  185
    391 |            2 |      40 |  145

i have try this :
     select id_lot,id_programme ,                                                    
     ratio_to_report(sum(prix)) over(partition by id_programme) as 
     ratio
     from t
     group by id_lot,id_programme;;

and i get this error : 

select id_lot,id_programme ,ratio_to_report(sum(prix)) over(...
                                      ^
  HINT:  No function matches the given name and argument types.  You might need to add explicit type casts. 

A:

You can explicitly do the calculation for ratio_to_report().   Does this work? 
select id_lot, id_programme,  
       sum(prix) / sum(sum(prix)) over (partition by id_programme) as ratio
from t
group by id_lot, id_programme;

Here is a db<>fiddle using Postgres.