Update sqlserver2pgsql.pl#26
Conversation
|
I'm a bit worried about the geography data type… This is much closer to the PostGIS geography type. This conversion wont work, I think, except in the most simple of cases (only points stored). Can you confirm this (I'm a PostgreSQL guy :) ) |
|
You are right, geography data type is much closer to PostGIS, but PostGIS is an extension of postgresql (at least I think so), I have mostly used MySQL & MSSQL , I'm a newbie in postgresql but when I stored coordinates in MSSQL I used the SqlGeography.Point Method , which is very similar to the point method of postgresql. More about that here: SqlGeography.Point Method (Double, Double, Int32) I know this is not a necessary pull request, I just encountered some errors when I was trying to convert xml and geography fields so I just used what was closer from one DB to another :) |
|
Yeah, sure, PostGIS is an extension. My point is that in 95% of cases, people migrating from SQL Server to PostgreSQL that have a geography type in SQL Server will need a geography type in PostgreSQL, and the full-fledged PostGIS. PostGIS itself is very easy to install, as long as you have packages (which you have for Redhat derivatives, Debian derivatives and Windows at least). So I'm thinking of a "bigger" patch, that will, as soon as a geography or geometry type is detected:
I will work on this when I have a little bit of time. |
|
Ok, it helped me a great deal today and I hope you will continue working on it because it's a great little script, all other software that is capable of migrating MSSQL to Postgresql is proprietary. When I thought all hope is lost and I had to edit the migrations by hand I stumbled upon your script 👍 |
|
Could you send me your SQL Server script at cousinmarc@gmail.com ? I'd like to check the patch I'm working on. It wont be public, I'll only use it for my regression testing Regards |
|
I'm afraid I can't send you the whole schema (I'm working for a company) but If you are ok with some partial data I think it won't be a problem |
|
On Wednesday 05 August 2015 07:05:47 Harry wrote:
Ok. |
|
Could you send me the extract from the schema ? Regards. |
|
I just need an example table… Can you take one of yours and anonymize its fields name ? Thanks |
|
Hello friend, sorry I was on vacation and had no internet access. |
|
Hi, just give me one table with geography in it, that will be sufficient. Thanks a lot. |
|
Here is a pastebin with the table script as it was produced from MSSQL server 2012 that contains the geography field, i have anonymized the fields. |
|
The GUI may be an idea. There are very few parameters though, so I don't know if it is worth the work. Rewritting this program in Java would seem a bit weird to me. And, as it is all about parsing the dump, I think it will be much harder, and very boring to write in Java. |
|
I added support for geography. It installs the postgis extension and warns the user that Postgis must be installed. Commit d1ef8b7 |
|
nice work 👍 |
|
As you want. Someone with no Unix experience should probably not switch to PostgreSQL though, except for very small databases, as PostgreSQL's performance is much lower with Windows. |
Just added xml and geography data types
xml > xml
geography > point
Really nice script btw, it saved me a lot of time, moving from SQL server to Postgresql is a pain in the ass 👎 . Your script helped me 👍