Thread: Access postgresql data base from .net

Access postgresql data base from .net

From
"mike stanton"
Date:
Hello all; we´ve got a project where we have a system built originally for .net/sql-server. Now we want to change sql-server for a postgresql database. And preferably without using the ODBC driver which we have heard is prone to errors. Is there a producto which we can use which does not imply a major rewrite of all the SQL ?. Obviously we may have problemas with differences between Sql-server and Postgresql syntax, but we don´t want to de a rewrite.
 
Hope to hear soon, any help appreciated.
 
Mike Stanton W.
Santiago Chile


__________ Información de ESET NOD32 Antivirus, versión de la base de firmas de virus 5575 (20101029) __________

ESET NOD32 Antivirus ha comprobado este mensaje.

http://www.eset.com

Re: Access postgresql data base from .net

From
Dann Corbit
Date:

From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of mike stanton
Sent: Friday, November 05, 2010 12:08 PM
To: pgsql-general@postgresql.org
Cc: mike stanton
Subject: [GENERAL] Access postgresql data base from .net

 

Hello all; we´ve got a project where we have a system built originally for .net/sql-server. Now we want to change sql-server for a postgresql database. And preferably without using the ODBC driver which we have heard is prone to errors.

>> 

What specific errors did you hear about?

I suggest testing the rumors.  If there really is some problem, then submit a bug report.

Sometimes, people want you to use their tools, and so they will exaggerate the problem with competitive tools.

<< 

 

Is there a producto which we can use which does not imply a major rewrite of all the SQL ?.

>> 

Probably most interface tools will work if you are using ISO standard SQL.  Any place where you are using SQL language extensions you will have to do some work.

You can find interfaces here:

http://pgfoundry.org/softwaremap/trove_list.php?form_cat=310

 

There are also a very large number of commercial interfaces for PostgreSQL available. You can find out about those here:

http://www.sqlsummit.com/DataAcce.htm

<< 

 

Obviously we may have problemas with differences between Sql-server and Postgresql syntax, but we don´t want to de a rewrite.

>> 

What specific problems are you having?

<< 

 

Hope to hear soon, any help appreciated.

 

Mike Stanton W.
Santiago Chile



__________ Información de ESET NOD32 Antivirus, versión de la base de firmas de virus 5575 (20101029) __________

ESET NOD32 Antivirus ha comprobado este mensaje.

http://www.eset.com

Re: Access postgresql data base from .net

From
"mike stanton"
Date:
 
Dann, perhaps the a better question would be.....if we use, for example, npgsql, we'd have to adapt code and use the tools own calls. And that means rewriting. Is this true?.
 
Cheers
Mike 
----- Original Message -----
Sent: Friday, November 05, 2010 5:12 PM
Subject: Re: [GENERAL] Access postgresql data base from .net

From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of mike stanton
Sent: Friday, November 05, 2010 12:08 PM
To: pgsql-general@postgresql.org
Cc: mike stanton
Subject: [GENERAL] Access postgresql data base from .net

 

Hello all; we´ve got a project where we have a system built originally for .net/sql-server. Now we want to change sql-server for a postgresql database. And preferably without using the ODBC driver which we have heard is prone to errors.

>> 

What specific errors did you hear about?

I suggest testing the rumors.  If there really is some problem, then submit a bug report.

Sometimes, people want you to use their tools, and so they will exaggerate the problem with competitive tools.

<< 

 

Is there a producto which we can use which does not imply a major rewrite of all the SQL ?.

>> 

Probably most interface tools will work if you are using ISO standard SQL.  Any place where you are using SQL language extensions you will have to do some work.

You can find interfaces here:

http://pgfoundry.org/softwaremap/trove_list.php?form_cat=310

 

There are also a very large number of commercial interfaces for PostgreSQL available. You can find out about those here:

http://www.sqlsummit.com/DataAcce.htm

<< 

 

Obviously we may have problemas with differences between Sql-server and Postgresql syntax, but we don´t want to de a rewrite.

>> 

What specific problems are you having?

<< 

 

Hope to hear soon, any help appreciated.

 

Mike Stanton W.
Santiago Chile



__________ Información de ESET NOD32 Antivirus, versión de la base de firmas de virus 5575 (20101029) __________

ESET NOD32 Antivirus ha comprobado este mensaje.

http://www.eset.com



__________ Información de ESET NOD32 Antivirus, versión de la base de firmas de virus 5575 (20101029) __________

ESET NOD32 Antivirus ha comprobado este mensaje.

http://www.eset.com

Re: Access postgresql data base from .net

From
Dann Corbit
Date:

In theory, if you are already using a .NET data provider, then you simply change the data source.  In practice, you might have to make a few small changes.

 

That is the entire beauty of using OLEDB, ODBC, .NET providers, etc.  Since you are coding to an industry standard, every data access tool that conforms to the standard should work without modification.

 

Now, if you are sending a SQL string that says “SP_WHO” PostgreSQL is not going to give you a list of attached users because that command is Microsoft SQL*Server specific.  But if you have a table with the identical data structure, then “SELECT ssn FROM employees WHERE bonus_conditions_met = 1” should work the same no matter what the data source is.

 

If you are using a database specific data interface (for instance, if you are connecting via DB-Library) then you will have to do some recoding, because DB-Library is specific to SQL*Server and Sybase. 

 

If you have an ODBC connection to a database in your code, and all your calls are ODBC calls, and if the application is written properly, then changing the database should be as simple as setting up a new data source.   Same for OLEDB.  Same for JDBC.  Same for .NET providers.  This is the entire and fundamental reason for using these tools.   Otherwise, we would all be using custom database API libraries instead.

 

From: mike stanton [mailto:mike.stanton@autocastillo.cl]
Sent: Friday, November 05, 2010 2:47 PM
To: Dann Corbit
Subject: Re: [GENERAL] Access postgresql data base from .net

 

Dann, perhaps the a better question would be.....if we use, for example, npgsql, we'd have to adapt code and use the tools own calls. And that means rewriting. Is this true?.

 

Cheers

Mike 

----- Original Message -----

Sent: Friday, November 05, 2010 5:12 PM

Subject: Re: [GENERAL] Access postgresql data base from .net

 

From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of mike stanton
Sent: Friday, November 05, 2010 12:08 PM
To: pgsql-general@postgresql.org
Cc: mike stanton
Subject: [GENERAL] Access postgresql data base from .net

 

Hello all; we´ve got a project where we have a system built originally for .net/sql-server. Now we want to change sql-server for a postgresql database. And preferably without using the ODBC driver which we have heard is prone to errors.

>> 

What specific errors did you hear about?

I suggest testing the rumors.  If there really is some problem, then submit a bug report.

Sometimes, people want you to use their tools, and so they will exaggerate the problem with competitive tools.

<< 

 

Is there a producto which we can use which does not imply a major rewrite of all the SQL ?.

>> 

Probably most interface tools will work if you are using ISO standard SQL.  Any place where you are using SQL language extensions you will have to do some work.

You can find interfaces here:

http://pgfoundry.org/softwaremap/trove_list.php?form_cat=310

 

There are also a very large number of commercial interfaces for PostgreSQL available. You can find out about those here:

http://www.sqlsummit.com/DataAcce.htm

<< 

 

Obviously we may have problemas with differences between Sql-server and Postgresql syntax, but we don´t want to de a rewrite.

>> 

What specific problems are you having?

<< 

 

Hope to hear soon, any help appreciated.

 

Mike Stanton W.
Santiago Chile



__________ Información de ESET NOD32 Antivirus, versión de la base de firmas de virus 5575 (20101029) __________

ESET NOD32 Antivirus ha comprobado este mensaje.

http://www.eset.com



__________ Información de ESET NOD32 Antivirus, versión de la base de firmas de virus 5575 (20101029) __________

ESET NOD32 Antivirus ha comprobado este mensaje.

http://www.eset.com

Re: Access postgresql data base from .net

From
"Francisco Figueiredo Jr."
Date:
We've made changes to support @ parameter prefix exactly to easy
porting of sqlserver client queries to postgresql. This way you may
need minimum changes to your code. Just to those specific sql calls.


On Fri, Nov 5, 2010 at 19:40, mike stanton <mike.stanton@autocastillo.cl> wrote:
>
> Dann, perhaps the a better question would be.....if we use, for example,
> npgsql, we'd have to adapt code and use the tools own calls. And that means
> rewriting. Is this true?.
>
> Cheers
> Mike
>
> ----- Original Message -----
> From: Dann Corbit
> To: 'mike stanton' ; pgsql-general@postgresql.org
> Cc: mike stanton
> Sent: Friday, November 05, 2010 5:12 PM
> Subject: Re: [GENERAL] Access postgresql data base from .net
>
> From: pgsql-general-owner@postgresql.org
> [mailto:pgsql-general-owner@postgresql.org] On Behalf Of mike stanton
> Sent: Friday, November 05, 2010 12:08 PM
> To: pgsql-general@postgresql.org
> Cc: mike stanton
> Subject: [GENERAL] Access postgresql data base from .net
>
>
>
> Hello all; we´ve got a project where we have a system built originally for
> .net/sql-server. Now we want to change sql-server for a postgresql database.
> And preferably without using the ODBC driver which we have heard is prone to
> errors.
>
>>>
>
> What specific errors did you hear about?
>
> I suggest testing the rumors.  If there really is some problem, then submit
> a bug report.
>
> Sometimes, people want you to use their tools, and so they will exaggerate
> the problem with competitive tools.
>
> <<
>
>
>
> Is there a producto which we can use which does not imply a major rewrite of
> all the SQL ?.
>
>>>
>
> Probably most interface tools will work if you are using ISO standard SQL.
> Any place where you are using SQL language extensions you will have to do
> some work.
>
> You can find interfaces here:
>
> http://pgfoundry.org/softwaremap/trove_list.php?form_cat=310
>
>
>
> There are also a very large number of commercial interfaces for PostgreSQL
> available. You can find out about those here:
>
> http://www.sqlsummit.com/DataAcce.htm
>
> <<
>
>
>
> Obviously we may have problemas with differences between Sql-server and
> Postgresql syntax, but we don´t want to de a rewrite.
>
>>>
>
> What specific problems are you having?
>
> <<
>
>
>
> Hope to hear soon, any help appreciated.
>
>
>
> Mike Stanton W.
> Santiago Chile
>
> __________ Información de ESET NOD32 Antivirus, versión de la base de firmas
> de virus 5575 (20101029) __________
>
> ESET NOD32 Antivirus ha comprobado este mensaje.
>
> http://www.eset.com
>
> __________ Información de ESET NOD32 Antivirus, versión de la base de firmas
> de virus 5575 (20101029) __________
>
> ESET NOD32 Antivirus ha comprobado este mensaje.
>
> http://www.eset.com
>



--
Regards,

Francisco Figueiredo Jr.
Npgsql Lead Developer
http://www.npgsql.org
http://fxjr.blogspot.com
http://twitter.com/franciscojunior

Re: Access postgresql data base from .net

From
John R Pierce
Date:
On 11/05/10 2:40 PM, mike stanton wrote:
> Dann, perhaps the a better question would be.....if we use, for
> example, npgsql, we'd have to adapt code and use the tools own calls.
> And that means rewriting. Is this true?.
>

npgsql implements oledb, I thought, which hooks right up to the .NET
database glue?   That should just hook up to your existing SQL code.  If
your SQL code follows the standards, it should work with little or no
tweaking.

however....

if you are using any Microsoft SQL Server specific features, you'll need
to rewrite those parts to switch to /anything/ else.    Any transact*sql
procedures will need rewriting into pl/pgsql.

SQL Server's ETL tool should be able to copy your schema and data into
postgres tables.