PostGIS data types don't work with JDBC-Postgres
------------------------------------------------

                 Key: JRUBY-4972
                 URL: http://jira.codehaus.org/browse/JRUBY-4972
             Project: JRuby
          Issue Type: Bug
          Components: Extensions
    Affects Versions: JRuby 1.5.1
            Reporter: Mike Perham


Using postgresql 8.4.4 and PostGIS 1.5.1 (the latest of each).  PostGIS adds 
several column data types, including 'point' which represents a geographic 
point.

There is a gem called spatial_adapter which adds support for the PostGIS data 
types to the standard AR postgresql driver.

Currently I can't migrate my database to create a point column due to this 
error:

{noformat}
ActiveRecord::ActiveRecordError: ERROR: type modifier is not allowed for type 
"point"
  Position: 36: ALTER TABLE "hoods" ADD "centroid" point(0)
{noformat}

The cause is this code in jdbc_adapter.rb:

{noformat}
      def choose_best_types
        type_map = {}
        @types.each do |row|
          name = row['type_name'].downcase
          k = name.to_sym
          type_map[k] = { :name => name }
          type_map[k][:limit] = row['precision'].to_i if row['precision']
        end
{noformat}

Here's the 'row' hash associated with the point type:

{noformat}
{"type_name"=>"point", "data_type"=>1111, "precision"=>0, 
"literal_prefix"=>"'", "literal_suffix"=>"'", "create_params"=>nil, 
"nullable"=>1, "case_sensitive"=>"t", "searchable"=>3, 
"unsigned_attribute"=>"t", "fixed_prec_scale"=>"f", "auto_increment"=>"f", 
"local_type_name"=>nil, "minimum_scale"=>0, "maximum_scale"=>0, 
"sql_data_type"=>nil, "sql_datetime_sub"=>nil, "num_prec_radix"=>10}
{noformat}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to