Configuring ODBC connection to Postgres
I am开发者_StackOverflow中文版 tasked with converting a very old Postges/PERL website to SQL Server /C#.
I have installed a current version of Postgres on my desktop and have imported most of the data from the old database (cut and paste).
Now I am trying to connect to that database using Visual Studio 2008/C#.
I have downloaded both 32 and 64 bit psqlODBC Postgres drivers. I can successfully create and test a user DSN using the 64 bit drivers, but I get an error in my C# code when I try to create the ODBC connection ("Unable to find an entry point named 'InterlockedIncrement' in DLL 'kernel32.dll'").
I have tried to install and use the 32 bit drivers, but I cannot create a DSN - they don't show up in the driver list, so I am a bit stuck.
If all you have to do is to convert that PostgreSQL database to other db engine then you can export whole PostgreSQL database to text using pg_dump
. There is possibility to export schema only, and then you can export data from interesting tables. They may be exported as INSERT ...
statements or as COPY
format similar to CSV. If you will go this way no ODBC is required.
精彩评论