Fetch the oid for schema.table_name.
(self, connection, table_name, schema=None, **kw)
| 3733 | |
| 3734 | @reflection.cache |
| 3735 | def get_table_oid(self, connection, table_name, schema=None, **kw): |
| 3736 | """Fetch the oid for schema.table_name.""" |
| 3737 | query = select(pg_catalog.pg_class.c.oid).where( |
| 3738 | pg_catalog.pg_class.c.relname == table_name, |
| 3739 | self._pg_class_relkind_condition( |
| 3740 | pg_catalog.RELKINDS_ALL_TABLE_LIKE |
| 3741 | ), |
| 3742 | ) |
| 3743 | query = self._pg_class_filter_scope_schema( |
| 3744 | query, schema, scope=ObjectScope.ANY |
| 3745 | ) |
| 3746 | table_oid = connection.scalar(query) |
| 3747 | if table_oid is None: |
| 3748 | raise exc.NoSuchTableError( |
| 3749 | f"{schema}.{table_name}" if schema else table_name |
| 3750 | ) |
| 3751 | return table_oid |
| 3752 | |
| 3753 | @reflection.cache |
| 3754 | def get_schema_names(self, connection, **kw): |