pgtoolkit/pgdatadiff.py
changeset 12 203be9022b46
parent 9 2fcc8ef0b97d
child 14 a900bc629ecc
equal deleted inserted replaced
11:bc69eca59041 12:203be9022b46
   188         for ln in self.iter_diff():
   188         for ln in self.iter_diff():
   189             print(ln.format_patch(self.fulltable2))
   189             print(ln.format_patch(self.fulltable2))
   190 
   190 
   191     def _select(self):
   191     def _select(self):
   192         browser = pgbrowser.PgBrowser(self.conn1)
   192         browser = pgbrowser.PgBrowser(self.conn1)
   193         columns = browser.list_columns(schema=self.schema1, table=self.table1)
   193         columns = browser.list_columns(schema=self.schema1, table=self.table1, order=1)
   194         columns_sel = ', '.join(['"' + x['name'] + '"' for x in columns])
   194         columns_sel = ', '.join(['"' + x['name'] + '"' for x in columns])
   195         self.colnames = [x['name'] for x in columns]
   195         self.colnames = [x['name'] for x in columns]
   196         
   196         
   197         query1 = 'SELECT ' + columns_sel + ' FROM ' + self.fulltable1 + ' ORDER BY 1;'
   197         query1 = 'SELECT ' + columns_sel + ' FROM ' + self.fulltable1 + ' ORDER BY 1;'
   198         query2 = 'SELECT ' + columns_sel + ' FROM ' + self.fulltable2 + ' ORDER BY 1;'
   198         query2 = 'SELECT ' + columns_sel + ' FROM ' + self.fulltable2 + ' ORDER BY 1;'