Fetch the oid for schema.table_name.
(self, connection, table_name, schema=None, **kw)
| 3880 | |
| 3881 | @reflection.cache |
| 3882 | def get_table_oid(self, connection, table_name, schema=None, **kw): |
| 3883 | """Fetch the oid for schema.table_name.""" |
| 3884 | query = select(pg_catalog.pg_class.c.oid).where( |
| 3885 | pg_catalog.pg_class.c.relname == table_name, |
| 3886 | self._pg_class_relkind_condition( |
| 3887 | pg_catalog.RELKINDS_ALL_TABLE_LIKE |
| 3888 | ), |
| 3889 | ) |
| 3890 | query = self._pg_class_filter_scope_schema( |
| 3891 | query, schema, scope=ObjectScope.ANY |
| 3892 | ) |
| 3893 | table_oid = connection.scalar(query) |
| 3894 | if table_oid is None: |
| 3895 | raise exc.NoSuchTableError( |
| 3896 | f"{schema}.{table_name}" if schema else table_name |
| 3897 | ) |
| 3898 | return table_oid |
| 3899 | |
| 3900 | @reflection.cache |
| 3901 | def get_schema_names(self, connection, **kw): |