Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I'm transferring my database from mysql to postgresql.

I have a latitude and longitude column for one of my models:

  t.float :latitude
  t.float :longitude

I'm using mysql2psql gem to load the mysql database into a postgres database locally.

The problem I have is after I transferred the mysql database to postgres I have data such as:

Latitude: 40 Longitude: -83

Rather than:

Latitude: 40.xxxx Longitude -83.xxxx

Please advise.

Mysql:

+
| Field                  | Type         | Null | Key | Default | Extra          |
+------------------------+--------------+------+-----+---------+----------------+
| latitude               | float        | YES  |     | NULL    |                |
| longitude              | float        | YES  |     | NULL    |    
share|improve this question
 
What are the source and target schemas? You can use desc table_name from the MySQL shell and \d table_name from psql. –  mu is too short Aug 9 at 5:23
 
Is there a way to check from pgadmin? –  Brian Rosedale Aug 9 at 5:30
 
psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"? I get this without using the admin tool, but that's another issue. –  Brian Rosedale Aug 9 at 5:30
 
Sorry, I don't know pgadmin, I prefer to do things by hand. –  mu is too short Aug 9 at 5:33
 
It seems the latitude value is double precision. When I use mysql2psql it converts it to numeric. –  Brian Rosedale Aug 9 at 5:42
show 3 more comments

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.