Please sign in to comment.
Remove custom table_exists? implementations
It is not safe for table_exists? to check the schema for a matching entry. The only safe way to operate is to issue a query selecting from the table name given and see if it raises an exception. Both the postgres and oracle shared adapters had code that checked against the database schema, which was fine in the past where table_exists? also checked for a cached database schema value. The change for PostgreSQL is not backwards compatible as its custom implementation accepted an optional options hash. The PostgreSQL implementation is also not backwards compatible in that previously, if you were using a table outside the schema search path, without qualifying it with a schema name, it would return true instead of false, even though attempting to actually select from the table would raise an error (since it wouldn't specify the schema). Try to be reasonably backwards compatible by automatically using a default_schema if one exists in table_exists?
- Loading branch information...
Showing with 6 additions and 28 deletions.