Returns the current search path as a list of schema names
(self)
| 478 | return title, None, None, cur.statusmessage |
| 479 | |
| 480 | def search_path(self): |
| 481 | """Returns the current search path as a list of schema names""" |
| 482 | |
| 483 | try: |
| 484 | with self.conn.cursor() as cur: |
| 485 | _logger.debug("Search path query. sql: %r", self.search_path_query) |
| 486 | cur.execute(self.search_path_query) |
| 487 | return [x[0] for x in cur.fetchall()] |
| 488 | except psycopg.ProgrammingError: |
| 489 | fallback = "SELECT * FROM current_schemas(true)" |
| 490 | with self.conn.cursor() as cur: |
| 491 | _logger.debug("Search path query. sql: %r", fallback) |
| 492 | cur.execute(fallback) |
| 493 | return cur.fetchone()[0] |
| 494 | |
| 495 | def view_definition(self, spec): |
| 496 | """Returns the SQL defining views described by `spec`""" |