# File lib/rubyrep/connection_extenders/postgresql_extender.rb, line 170
      def referenced_tables(tables)
        rows = self.select_all("select distinct referencing.relname as referencing_table, referenced.relname as referenced_table\nfrom pg_class referencing\nleft join pg_constraint on referencing.oid = pg_constraint.conrelid\nleft join pg_class referenced on pg_constraint.confrelid = referenced.oid\nwhere referencing.relkind='r'\nand referencing.relname in ('\#{tables.join(\"', '\")}')\nand referencing.relnamespace IN\n(SELECT oid FROM pg_namespace WHERE nspname in (\#{schemas}))\n")
        result = {}
        rows.each do |row|
          unless result.include? row['referencing_table']
            result[row['referencing_table']] = []
          end
          if row['referenced_table'] != nil
            result[row['referencing_table']] << row['referenced_table']
          end
        end
        result
      end