postgres is really thinking outside the SQL box and I love it. JSON support was great and Javascript fits in with it. Now how about support for other languages like Python/Ruby/Lua?
PM of Heroku Postgres here. Part of choosing JavaScript and in particular V8 was that its a fully sandboxed language. Other languages while also very powerful can have various security risks that come along with them.
In the future we may support additional languages and if there's particular ones please feel free to drop us a line at postgres@heroku.com and let us know which ones you'd like and why.
Thanks for the response. OK, I buy the security issue. My Javascript skills - once pretty good - are bit rusty so Ill have to brush up on it. But I do have an ides for a project and will download postgres later today.
Procedural language handlers exist in the core distribution for Perl, Python, Tcl, and PostgreSQL's own procedural language, PL/pgSQL.
Third party handlers exist, off the top of my head, for JavaScript (obviously; see TFA), R, Ruby, Scheme and shell. That list probably isn't remotely exhaustive.
To be honest, though, I've never really had much of a use for any language other than pl/pgsql and occasionally pl/r; I try to keep anything too complicated outside of the database.
The languages are, I guess, most useful for people who design their database as a datastore with an API, used by multiple independent clients (a common setup in enterprises). The API typically consists of stored procedures, and normal queries are disallowed for most usernames.
Being able to implement such an API in $DECENT_LANGUAGE and not pl/pgsql sounds like an enormous win.
> Postgres is an extensible database. That's the beauty of the project.
I agree, I just thought from the reference to JSON (which is a core database feature) that PL/v8 was being incorrectly attributed the postgres team directly.
> I don't think you'd say "well, Ruby is awesome but web application development support comes from a third-party project, not the standard library."
I might if someone pointed to Rails with a comment that implied it was a credit to the Ruby team and a next step to a stdlib feature.
Comments
postgres is really thinking outside the SQL box and I love it. JSON support was great and Javascript fits in with it. Now how about support for other languages like Python/Ruby/Lua?
PM of Heroku Postgres here. Part of choosing JavaScript and in particular V8 was that its a fully sandboxed language. Other languages while also very powerful can have various security risks that come along with them.
In the future we may support additional languages and if there's particular ones please feel free to drop us a line at postgres@heroku.com and let us know which ones you'd like and why.
Thanks for the response. OK, I buy the security issue. My Javascript skills - once pretty good - are bit rusty so Ill have to brush up on it. But I do have an ides for a project and will download postgres later today.
PL/Lua can be installed in either trusted and untrusted versions.
http://pllua.projects.pgfoundry.org/
any chance of supporting fdw(foreign data wrappers)?
We're very excited to see FDWs evolve. In the future theres some chance we will support them, but no immediate timeline available.
postgres 9.3 is bringing writes to FDW and this will be really interesting
Except that around 1999 it was already possible to write stored procedures in Perl on Oracle. Eventually it was replaced by Java.
SQL Server allows for .NET stored procedures, so you could already use something like JScript.NET.
I fail to see what you mean by thinking out of the box.
Well, at least they're thinking outside MySQL's box.
That's true of pretty much any database.
Procedural language handlers exist in the core distribution for Perl, Python, Tcl, and PostgreSQL's own procedural language, PL/pgSQL.
Third party handlers exist, off the top of my head, for JavaScript (obviously; see TFA), R, Ruby, Scheme and shell. That list probably isn't remotely exhaustive.
Java and C too.
To be honest, though, I've never really had much of a use for any language other than pl/pgsql and occasionally pl/r; I try to keep anything too complicated outside of the database.
The languages are, I guess, most useful for people who design their database as a datastore with an API, used by multiple independent clients (a common setup in enterprises). The API typically consists of stored procedures, and normal queries are disallowed for most usernames.
Being able to implement such an API in $DECENT_LANGUAGE and not pl/pgsql sounds like an enormous win.
> postgres is really thinking outside the SQL box and I love it. JSON support was great and Javascript fits in with it.
Postgres is awesome, but the JavaScript support from PL/V8 is a third-party extension, not a core database feature.
Postgres is an extensible database. That's the beauty of the project.
I don't think you'd say "well, Ruby is awesome but web application development support comes from a third-party project, not the standard library."
> Postgres is an extensible database. That's the beauty of the project.
I agree, I just thought from the reference to JSON (which is a core database feature) that PL/v8 was being incorrectly attributed the postgres team directly.
> I don't think you'd say "well, Ruby is awesome but web application development support comes from a third-party project, not the standard library."
I might if someone pointed to Rails with a comment that implied it was a credit to the Ruby team and a next step to a stdlib feature.
That's fair enough. It's worth noting that Hitoshi Harada, the original author, is a long time contributor to the core project.
Python has been available since v8.4: http://www.postgresql.org/docs/9.2/static/plpython.html.