Thread: Question About PostgreSQL Extensibility

Question About PostgreSQL Extensibility

From
Sepideh Eidi
Date:

Hi madam/sir,

 

Our company want to use a database for first time, we select PostgreSQL from a list of open-source Databases. But at first, we want to be sure about something. We have some .net assemblies and in your documents, I didn’t find any support for this type of files that is executable in DB or not. Would you please tell me that .net assemblies files are executable in PostgreSQL or not? Or is there any way for calling assembly methods inside DB?

 

Best regard,

 

Sepideh Eidi

Software Development

 

      

 

 

 

REILHOFER KG

Zugspitzstraße 5 - 85757 Karlsfeld - Germany

Tel +49 8131 59295 72 - Fax +49 8131 97447

eidi@rhf.de - www.rhf.de

 

        

  

General Manager: Stefan Salvermoser. Registergericht: Amtsgericht München, HRA 65361

 

Attachment

Re: Question About PostgreSQL Extensibility

From
Laurenz Albe
Date:
On Thu, 2023-10-12 at 06:09 +0000, Sepideh Eidi wrote:
> We have some .net assemblies and in your documents, I didn’t find any support for this
> type of files that is executable in DB or not. Would you please tell me that .net
> assemblies files are executable in PostgreSQL or not? Or is there any way for calling
> assembly methods inside DB?

There is no support for that.  I guess somebody could write an extension PL/net,
and it looks like somebody already has: https://github.com/witblitz/pldotnet.
That code ptobably won't work with recent PostgreSQL releases, but it could be
a basis for you to work upon.

My big question for me is: Why on earth would you want to run .NET code inside a
database?  Why not run it on the client?

Yours,
Laurenz Albe



Re: Question About PostgreSQL Extensibility

From
Ilya Kosmodemiansky
Date:
Hi Sepideh,

> From: Sepideh Eidi <eidi@rhf.de>
> Date: Thu, Oct 12, 2023 at 2:35 PM
> Subject: Question About PostgreSQL Extensibility
> To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

> We have some .net assemblies and in your documents, I didn’t find any support for this type of files that is
executablein DB or not. 

PostgreSQL doesn't support .net assemblies like SQL Server does. In
Postgres you can certainly write stored procedures in different
languages, for example in C, but I am not sure if it would solve your
problem

v. G.,
Ilya





best regards,
Ilya Kosmodemiansky,
CEO, Data Egret GmbH
Herrenstr. 1 A 2,
Spiesen-Elversberg, Germany



Re: Question About PostgreSQL Extensibility

From
Chris Travers
Date:


On Thu, Oct 12, 2023 at 10:09 PM Ilya Kosmodemiansky <ik@dataegret.com> wrote:
Hi Sepideh,

> From: Sepideh Eidi <eidi@rhf.de>
> Date: Thu, Oct 12, 2023 at 2:35 PM
> Subject: Question About PostgreSQL Extensibility
> To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

> We have some .net assemblies and in your documents, I didn’t find any support for this type of files that is executable in DB or not.

PostgreSQL doesn't support .net assemblies like SQL Server does. In
Postgres you can certainly write stored procedures in different
languages, for example in C, but I am not sure if it would solve your
problem

Also if you are self-hosting, you can write and add your own language handlers.  So if you need to support .Net assemblies, this is at least in theory possible.

Note that there are significant reasons to consider rewriting in other languages, however.  The large one is that .Net prefers a very different threading model than Postgres and so that's something that has to be solved (though the Pl/Java folks have solved that problem for Java). 
 

v. G.,
Ilya





best regards,
Ilya Kosmodemiansky,
CEO, Data Egret GmbH
Herrenstr. 1 A 2,
Spiesen-Elversberg, Germany




--
Best Wishes,
Chris Travers

Efficito:  Hosted Accounting and ERP.  Robust and Flexible.  No vendor lock-in.

Re: Question About PostgreSQL Extensibility

From
felix.quintgz@yahoo.com
Date:
For the same reason that you can use python or perl in postgresql. It's just another language.
I have .net code running on several sql servers and to change the database to postgresql I have to reprogram them.

 On Thursday, October 12, 2023 at 09:44:08 AM GMT-4, Laurenz Albe <laurenz.albe@cybertec.at> wrote:

 On Thu, 2023-10-12 at 06:09 +0000, Sepideh Eidi wrote:
> We have some .net assemblies and in your documents, I didn’t find any support for this
> type of files that is executable in DB or not. Would you please tell me that .net
> assemblies files are executable in PostgreSQL or not? Or is there any way for calling
> assembly methods inside DB?

There is no support for that.  I guess somebody could write an extension PL/net,
and it looks like somebody already has: https://github.com/witblitz/pldotnet.
That code ptobably won't work with recent PostgreSQL releases, but it could be
a basis for you to work upon.

My big question for me is: Why on earth would you want to run .NET code inside a
database?  Why not run it on the client?

Yours,
Laurenz Albe



Re: Question About PostgreSQL Extensibility

From
Laurenz Albe
Date:
On Fri, 2023-10-13 at 13:55 +0000, felix.quintgz@yahoo.com wrote:
> For the same reason that you can use python or perl in postgresql. It's just another language.
> I have .net code running on several sql servers and to change the database to postgresql I have to reprogram them.

Yes, you'll have to rewrite them.

Yours,
Laurenz Albe



Re: Question About PostgreSQL Extensibility

From
Chris Travers
Date:


On Mon, Oct 16, 2023 at 10:59 PM Laurenz Albe <laurenz.albe@cybertec.at> wrote:
On Fri, 2023-10-13 at 13:55 +0000, felix.quintgz@yahoo.com wrote:
> For the same reason that you can use python or perl in postgresql. It's just another language.
> I have .net code running on several sql servers and to change the database to postgresql I have to reprogram them.

Yes, you'll have to rewrite them.

Or pick up the pldotnet handler and patch it to work on the new version.  My experience forward porting such things is that it is usually trivial.

Of course there may be other reasons to rewrite but it really depends on a lot of factors.
 

Yours,
Laurenz Albe




--
Best Wishes,
Chris Travers

Efficito:  Hosted Accounting and ERP.  Robust and Flexible.  No vendor lock-in.