I'm trying to store binary data into bytea data type column. But Postgres the column of type bytea can hold up to 1 GB of binary data, it would require a huge amount of memory to process such a large value.

Question : The max binary data Im storing to store should not exceed more than 128MB.
Is there any way to restrict bytea data type should store only 128MB data and tweak the rest of the memory from 1GB allocated memory.