Please sign in to comment.
Don't use a schema by default on postgresql
Before, the shared PostgreSQL adapter had a default schema of public. This was added to fix some issues when a user had a tables with the same name in multiple schemas. This commit changes it so that a default schema can still be specified, but removes the built-in default of public. Internally, this changes some constants in AdapterMethods from strings to procs that take schemas and tables, and changes the SQL they produce to not check for a specific schema unless a schema is provided. This commit removes the private Database instance methods primary_key_for_table and primary_key_sequence_from_table, and changes the API to the public Database instance method primary_key, and adds the public Database instance method primary_key_sequence. It also fixes a performance issue when a table does not have a primary key, where it would query for the primary key every time, instead of using the cached negative lookup. This commit also adds a couple commented out lines to the postgres and integration tests. Because the code paths for Postgres 8.2 and later and 8.1 and earlier are very different when it comes to inserting records, testing both is a good idea whenever changes are made to this area of the code.
- Loading branch information...
Showing with 58 additions and 56 deletions.