В postgresql.conf в самом конце нужно в секции
#---------------------------------------------------------------------------
# CUSTOMIZED OPTIONS #---------------------------------------------------------------------------
custom_variable_classes = ''
# list of custom variable class names
Поменять на custom_variable_classes = 'something'
Потом можно в постгре делать
select set_config('something.hernya','lalala',false); select current_setting('something.hernya')