Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #4046 (new defect)

Opened 3 years ago

Last modified 2 years ago

[PATCH] Also dump the PostgreSQL search_path on dump_schema_information

Reported by: bigsmoke@gmail.com Assigned to: David
Priority: high Milestone:
Component: ActiveRecord Version: 1.0.0
Severity: critical Keywords: postgresql
Cc:

Description

The clone_structure_to_test rake task uses the ActiveRecord::ConnectionAdapters::SchemaStatements#dump_schema_information method to dump the insert statement which set the correct version in the schema_info table.

This won't work correctly when using PostgreSQL schemas because, unlike psql which is used for dumping the rest of the schema, the dump_schema_information doesn't take into account the schema in which the table resides.

To fix this, I've overrided the dump_schema_information in the PostgreSQLAdaptor. The new method simply returns the PgSQL "SET search_path" statement followed by the return value of SchemaStatements#dump_schema_information.

Attachments

dump_postgresql_search_path_on_dump_schema_information.diff (0.7 kB) - added by bigsmoke@gmail.com on 03/02/06 14:46:06.
The actual patch file. I think it ought to be possible to attach a file from the submission interface.

Change History

03/02/06 14:46:06 changed by bigsmoke@gmail.com

  • attachment dump_postgresql_search_path_on_dump_schema_information.diff added.

The actual patch file. I think it ought to be possible to attach a file from the submission interface.

03/02/06 14:51:22 changed by bigsmoke@gmail.com

  • priority changed from highest to high.

04/20/07 22:39:53 changed by josh

  • keywords set to postgresql.