PostgreSQL Size Quota on Table or Schema
You can create a trigger that checks the number of records in your destination table when an INSERT is used.

The trigger function would look like this:

CREATE OR REPLACE FUNCTION check_number_of_row()
RETURNS TRIGGER AS
$body$
BEGIN
    -- replace 100 by the number of rows you want
    IF (SELECT count(*) FROM your_table) &gt; 100
    THEN 
        RAISE EXCEPTION 'INSERT statement exceeding maximum number of rows for this table' 
    END IF;
END;
$body$
LANGUAGE plpgsql;

And trigger will be like this : - 

CREATE TRIGGER tr_check_number_of_row 
BEFORE INSERT ON your_table
FOR EACH ROW EXECUTE PROCEDURE check_number_of_row();

There is no other way i think to set table size in postgresql but u can restrict row limit on table