This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Cidr(postgresql.CIDR): | |
''' | |
Делаем свой тип колонки для того, чтобы была возможность использовать | |
операторы >> и << | |
''' | |
class comparator_factory(postgresql.CIDR.Comparator): | |
def __lshift__(self, other): | |
return self.op("<<")(other) | |
def __rshift__(self, other): | |
return self.op(">>")(other) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
n.nspname AS "schema", | |
c.relname AS "index" | |
FROM | |
pg_catalog.pg_class AS c | |
LEFT JOIN pg_catalog.pg_namespace AS n ON n.oid = c.relnamespace | |
WHERE | |
c.relkind = 'i' | |
AND | |
n.nspname NOT IN ('pg_catalog', 'pg_toast') |