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

Ticket #3125 (closed defect: invalid)

Opened 3 years ago

Last modified 1 year ago

[PATCH] postgresql schema_search_path invalid assumption

Reported by: anonymous Assigned to: David
Priority: normal Milestone:
Component: ActiveRecord Version: edge
Severity: normal Keywords: postgresql schema_search_path unverified tiny
Cc:

Description

The schema_search_path returned from postgres is of the format:

"schema1, schema2, schema3"

Note that there may be a space after the comma (in postgres 8.0 at least)

postgresql_adapter.rb:tables() assumes no space character.

Near line 140

schemas = schema_search_path.split(/,/).map { |p| quote(p) }.join(',')

The simple fix is:

schemas = schema_search_path.split(/,/).map { |p| quote(p.strip) }.join(',')

This bug causes rake db_schema_dump to fail to generate tables in the 2nd and further schemas listed in the schema_search_path.

Change History

12/07/05 14:02:20 changed by anonymous

A simpler fix is to adjust the initial regexp:

schemas = schema_search_path.split(/, */).map { |p| quote(p) }.join(',')

03/13/07 02:35:15 changed by josh

  • keywords changed from postgresql schema_search_path to postgresql schema_search_path unverified.

05/25/07 07:43:03 changed by brynary

  • keywords changed from postgresql schema_search_path unverified to postgresql schema_search_path unverified tiny.
  • version changed from 0.14.3 to edge.

05/25/07 08:07:45 changed by danger

  • status changed from new to closed.
  • resolution set to invalid.

This is neither patched nor tested. Please reopen with a test.