Improve identify_system: don't hardcode column names

This commit is contained in:
Oleksandr Shulgin 2015-06-02 16:52:48 +02:00
parent 80da76d43f
commit 44b705f88f

View File

@ -488,7 +488,7 @@ class ReplicationCursor(_cursor):
"""Get information about the cluster status.""" """Get information about the cluster status."""
self.execute("IDENTIFY_SYSTEM") self.execute("IDENTIFY_SYSTEM")
return dict(zip(['systemid', 'timeline', 'xlogpos', 'dbname'], return dict(zip([_.name for _ in self.description],
self.fetchall()[0])) self.fetchall()[0]))
def quote_ident(self, ident): def quote_ident(self, ident):