slot.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:pg2kinesis 作者: handshake 项目源码 文件源码
def create_slot(self):
        logger.info('Creating slot %s' % self.slot_name)
        try:
            self._repl_cursor.create_replication_slot(self.slot_name,
                                                      slot_type=psycopg2.extras.REPLICATION_LOGICAL,
                                                      output_plugin='test_decoding')
        except psycopg2.ProgrammingError as p:
            # Will be raised if slot exists already.
            if p.pgcode != psycopg2.errorcodes.DUPLICATE_OBJECT:
                logger.error(p)
                raise
            else:
                logger.info('Slot %s is already present.' % self.slot_name)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号