code: def register_type(self, oids, name, casting):
          
          assert type(oids) is tuple
          assert isinstance(name, basestring)
          assert hasattr(casting, '__call__')
          self._register_types.append((oids, name, casting))
          psycopg2.extensions.register_type(psycopg2.extensions.new_type(oids, name, casting))
docs: Callback to register data types when reconnect