> I have attached a patch just for the quick thought. Otherwise there is no > issue with patch.
This is no good - the security_check() needs established connection to work on.
I know it but after putting the superuser check just above the security_check function make this function almost useless and now it doesn't need PGconn parameter.
BTW it was just my suggestion otherwise patch looks ok to me