Re: [GENERAL] Using Postgresql as application server

2011-08-28 Thread Merlin Moncure
On Sat, Aug 27, 2011 at 11:43 PM, Andrej wrote: > On 19 August 2011 04:16, Merlin Moncure wrote: >>> It's been around for a long time already: >>> >>>  http://asmith.id.au/mod_libpq.html >> mod_libpq looks like it hasn't been updated in quite a while (apache >> 1.3 only) -- I think a node.js http

Re: [GENERAL] Using Postgresql as application server

2011-08-28 Thread Dimitri Fontaine
[edited] Merlin Moncure writes:  http://asmith.id.au/mod_libpq.html >> http://asmith.id.au/source/mod_libpq2.c > > node.js is even thinner. > > node.js is single threaded and 100% asynchronous which fits very nice > with libpq which is at heart a single threaded asynchronous library. Sure.

Re: [GENERAL] Using Postgresql as application server

2011-08-27 Thread Andrej
On 19 August 2011 04:16, Merlin Moncure wrote: >> It's been around for a long time already: >> >>  http://asmith.id.au/mod_libpq.html > mod_libpq looks like it hasn't been updated in quite a while (apache > 1.3 only) -- I think a node.js http server is superior in just about > every way for this c

Re: [GENERAL] Using Postgresql as application server

2011-08-18 Thread Dmitriy Igrishin
2011/8/18 s...@bestmx.ru > Dmitriy Igrishin пишет: > >> >> >> 2011/8/18 s...@bestmx.ru > s...@bestmx.ru>> >> >>Dmitriy Igrishin пишет: >> >> >> >>2011/8/18 s...@bestmx.ru >>> >

Re: [GENERAL] Using Postgresql as application server

2011-08-18 Thread Chris Travers
On Thu, Aug 18, 2011 at 4:32 AM, Sim Zacks wrote: > There are many differences. > 1) If I have a database function and I copy my database to another server, > the function still works. > If I have an external daemon application, I not only have to copy my > database, I also have to copy the daemo

Re: [GENERAL] Using Postgresql as application server

2011-08-18 Thread s...@bestmx.ru
Dmitriy Igrishin пишет: 2011/8/18 s...@bestmx.ru > Dmitriy Igrishin пишет: 2011/8/18 s...@bestmx.ru > mailto:s...@bestmx.ru>

Re: [GENERAL] Using Postgresql as application server

2011-08-18 Thread Dmitriy Igrishin
2011/8/18 s...@bestmx.ru > Dmitriy Igrishin пишет: > >> >> >> 2011/8/18 s...@bestmx.ru > s...@bestmx.ru>> >> >> >>Merlin Moncure пишет: >> >>On Thu, Aug 18, 2011 at 5:48 AM, Dimitri Fontaine >>mailto:dimi...@2ndquadrant.fr**>> wrote: >> >> >>

Re: [GENERAL] Using Postgresql as application server

2011-08-18 Thread s...@bestmx.ru
Dmitriy Igrishin пишет: 2011/8/18 s...@bestmx.ru > Merlin Moncure пишет: On Thu, Aug 18, 2011 at 5:48 AM, Dimitri Fontaine mailto:dimi...@2ndquadrant.fr>> wrote: c kmailto:shreeseva.learn...@gmail.com>> writes:

Re: [GENERAL] Using Postgresql as application server

2011-08-18 Thread Dmitriy Igrishin
2011/8/18 s...@bestmx.ru > Merlin Moncure пишет: > > On Thu, Aug 18, 2011 at 5:48 AM, Dimitri Fontaine >> wrote: >> >>> c k writes: >>> Many users are using it and found it stable and scalable. Important is that web server is external to the database and a mod_pgsql like mod_pl

Re: [GENERAL] Using Postgresql as application server

2011-08-18 Thread s...@bestmx.ru
Merlin Moncure пишет: On Thu, Aug 18, 2011 at 5:48 AM, Dimitri Fontaine wrote: c k writes: Many users are using it and found it stable and scalable. Important is that web server is external to the database and a mod_pgsql like mod_plsql is used to connect web server to database. Each page is

Re: [GENERAL] Using Postgresql as application server

2011-08-18 Thread Merlin Moncure
On Thu, Aug 18, 2011 at 5:48 AM, Dimitri Fontaine wrote: > c k writes: >> Many users are using it and found it stable and scalable. Important is that >> web server is external to the database and a mod_pgsql like mod_plsql is >> used to connect web server to database. Each page is considered as a

Re: [GENERAL] Using Postgresql as application server

2011-08-18 Thread Chris Travers
On Thu, Aug 18, 2011 at 3:40 AM, Dimitri Fontaine wrote: > Chris Travers writes: >> I want an email to go out to the ordering manager when the quantity I >> have of an item drops below the re-order point.  I also want this >> email NOT to go out if the transaction rolls back.  (Wait, the order >>

Re: [GENERAL] Using Postgresql as application server

2011-08-18 Thread Sim Zacks
On 08/18/2011 07:57 AM, Chris Travers wrote: On Wed, Aug 17, 2011 at 9:38 PM, Sim Zacks wrote: The point was not whether I have a bug in an external application, the point is that I need an external application which creates more overhead and another point o

Re: [GENERAL] Using Postgresql as application server

2011-08-18 Thread Dimitri Fontaine
c k writes: > Many users are using it and found it stable and scalable. Important is that > web server is external to the database and a mod_pgsql like mod_plsql is > used to connect web server to database. Each page is considered as a stored > procedure in the oracle database. I am not thinking o

Re: [GENERAL] Using Postgresql as application server

2011-08-18 Thread Dimitri Fontaine
Chris Travers writes: > I want an email to go out to the ordering manager when the quantity I > have of an item drops below the re-order point. I also want this > email NOT to go out if the transaction rolls back. (Wait, the order > of 5 widgets I just processed rolled back because it isn't

Re: [GENERAL] Using Postgresql as application server

2011-08-17 Thread Chris Travers
On Wed, Aug 17, 2011 at 9:38 PM, Sim Zacks wrote: > The point was not whether I have a bug in an external application, the point > is that I need an external application which creates more overhead and > another point of failure in the application stack. > 1) Not sure how an external python scri

Re: [GENERAL] Using Postgresql as application server

2011-08-17 Thread Sim Zacks
On 08/17/2011 05:34 PM, Scott Ribe wrote: On Aug 17, 2011, at 1:05 AM, Sim Zacks wrote: One problem we have with LISTEN/NOTIFY (and I haven't found the cause for this yet) is every once in a while my daemon stops listening. It may be after a month of use or l

Re: [GENERAL] Using Postgresql as application server

2011-08-17 Thread Sim Zacks
On 08/17/2011 06:13 PM, Chris Travers wrote: On Tue, Aug 16, 2011 at 11:53 PM, Sim Zacks wrote: We are doing this same sort of thing now. If the transaction goes through, the email record gets written to a table. We have a cron job that calls a database func

Re: [GENERAL] Using Postgresql as application server

2011-08-17 Thread Craig Ringer
On 18/08/2011 12:35 AM, John R Pierce wrote: On 08/17/11 7:40 AM, Merlin Moncure wrote: GRANT/REVOKE only constrain read/write privileges to a database. at a table level, and even distinguishing between INSERT (writing new data) and UPDATING (updating existing data). Column level, actually

Re: [GENERAL] Using Postgresql as application server

2011-08-17 Thread John R Pierce
On 08/17/11 7:40 AM, Merlin Moncure wrote: GRANT/REVOKE only constrain read/write privileges to a database. at a table level, and even distinguishing between INSERT (writing new data) and UPDATING (updating existing data). you can get even finer granularity, using functions with SECURITY_DEF

Re: [GENERAL] Using Postgresql as application server

2011-08-17 Thread Chris Travers
On Wed, Aug 17, 2011 at 7:40 AM, Merlin Moncure wrote: > > GRANT/REVOKE only constrain read/write privileges to a database. > Application level security is typically much finer grained than that. > Also, I using SQL roles for actual user roles is not typically done > for various reasons.  General

Re: [GENERAL] Using Postgresql as application server

2011-08-17 Thread Chris Travers
On Tue, Aug 16, 2011 at 11:53 PM, Sim Zacks wrote: > We are doing this same sort of thing now. If the transaction goes through, > the email record gets written to a table. We have a cron job that calls a > database function that processes all emails that have not been processed > yet. If the tran

Re: [GENERAL] Using Postgresql as application server

2011-08-17 Thread Merlin Moncure
On Tue, Aug 16, 2011 at 6:14 PM, Chris Travers wrote: > On Tue, Aug 16, 2011 at 3:51 PM, Merlin Moncure wrote: > >> >> /shrug.  pretty much every project I've ever worked on application >> security has been ad hoc, database driven, not very complicated, and >> not a performance bottleneck.  By th

Re: [GENERAL] Using Postgresql as application server

2011-08-17 Thread Scott Ribe
On Aug 17, 2011, at 1:05 AM, Sim Zacks wrote: > One problem we have with LISTEN/NOTIFY (and I haven't found the cause for > this yet) is every once in a while my daemon stops listening. It may be after > a month of use or longer, and may be caused by the database being restarted > or something

Re: [GENERAL] Using Postgresql as application server

2011-08-17 Thread Scott Ribe
On Aug 17, 2011, at 12:53 AM, Sim Zacks wrote: > In your scenario, if you send the NOTIFY message and then you roll back the > transaction, the helper application will still send the email. How? NOTIFY doesn't get delivered until the transaction commits. -- Scott Ribe scott_r...@elevated-dev.c

Re: [GENERAL] Using Postgresql as application server

2011-08-17 Thread Sim Zacks
On 08/16/2011 07:04 AM, Darren Duncan wrote: Chris Travers wrote: On Mon, Aug 15, 2011 at 3:47 PM, Darren Duncan wrote: I believe we basically have all the foundation already, with maybe procedures executable outside transactions being the last major part. Why is this desirable? Why is it mo

Re: [GENERAL] Using Postgresql as application server

2011-08-16 Thread Sim Zacks
On 08/15/2011 11:50 PM, Chris Travers wrote: On Mon, Aug 15, 2011 at 1:44 PM, Darren Duncan wrote: I believe that it is ideal for Postgres to be computationally complete in that one *could* use it to implement a complete application. That isn't to say one should do this as a matter of course,

Re: [GENERAL] Using Postgresql as application server

2011-08-16 Thread Sim Zacks
On 08/16/2011 03:06 AM, Craig Ringer wrote: On 15/08/2011 10:36 PM, Merlin Moncure wrote: On Sat, Aug 13, 2011 at 2:30 PM, Andreas Joseph Krogh wrote: No, PG has never, and will never, act as an application-server. Why in the world not? The biggest reason is safety. Beyond that, the lack of

Re: [GENERAL] Using Postgresql as application server

2011-08-16 Thread c k
In this war no one is looking at APEX from oracle. Oracle have implemented the whole webserver to DBMS gateway and web development and a web based business solutions in the database it self. They are using pl/sql for this. Many users are using it and found it stable and scalable. Important is that

Re: [GENERAL] Using Postgresql as application server

2011-08-16 Thread Chris Travers
On Tue, Aug 16, 2011 at 3:51 PM, Merlin Moncure wrote: > > /shrug.  pretty much every project I've ever worked on application > security has been ad hoc, database driven, not very complicated, and > not a performance bottleneck.  By the way, I think the opposite of > you: security information rel

Re: [GENERAL] Using Postgresql as application server

2011-08-16 Thread Merlin Moncure
On Tue, Aug 16, 2011 at 4:04 PM, Chris Travers wrote: > On Tue, Aug 16, 2011 at 12:31 PM, Merlin Moncure wrote: > >>> Who enforces security and how? >> >> *) http wrapper (example node.js): check security in the wrapper. >> presumably your application server would be keeping sessions state >

Re: [GENERAL] Using Postgresql as application server

2011-08-16 Thread Chris Travers
On Tue, Aug 16, 2011 at 12:31 PM, Merlin Moncure wrote: >>> >> Who enforces security and how? > > *) http wrapper (example node.js): check security in the wrapper. > presumably your application server would be keeping sessions state > independently of database session and would do verification on

Re: [GENERAL] [] Using Postgresql as application server

2011-08-16 Thread Steve Atkins
On Aug 16, 2011, at 11:42 AM, John R Pierce wrote: > > this whole discussion reminds me of the old adage... > >if your only tool is a hammer, every problem looks like a nail. I'm amazed nobody has mentioned http://www.sqlonrails.org/ yet. Cheers, Steve -- Sent via pgsql-general maili

Re: [GENERAL] Using Postgresql as application server

2011-08-16 Thread Merlin Moncure
On Tue, Aug 16, 2011 at 1:47 PM, Chris Travers wrote: > On Tue, Aug 16, 2011 at 11:08 AM, Merlin Moncure wrote: > >> why not?  if you are serving http, just put thin connection pooler in >> your http server (node.js would be great for that).  if you are >> serving libpq directly, you can pool wit

Re: [GENERAL] Using Postgresql as application server

2011-08-16 Thread Chris Travers
On Tue, Aug 16, 2011 at 11:08 AM, Merlin Moncure wrote: > why not?  if you are serving http, just put thin connection pooler in > your http server (node.js would be great for that).  if you are > serving libpq directly, you can pool with pgbouncer. > Who enforces security and how? Best Wishes, C

Re: [GENERAL] [] Using Postgresql as application server

2011-08-16 Thread John R Pierce
this whole discussion reminds me of the old adage... if your only tool is a hammer, every problem looks like a nail. -- john r pierceN 37, W 122 santa cruz ca mid-left coast -- Sent via pgsql-general mailing list (pgsql-general@postgre

Re: [GENERAL] Using Postgresql as application server

2011-08-16 Thread Merlin Moncure
On Tue, Aug 16, 2011 at 12:52 AM, Chris Travers wrote: > On Mon, Aug 15, 2011 at 10:05 PM, Scott Marlowe > wrote: > >> >> Yep.  Also, it's REAL easy to stick a caching layer like memcached >> into the middle tier app layer, but nearly impossible to do so in >> pgsql.  For large systems, this wou

Re: [GENERAL] Using Postgresql as application server

2011-08-15 Thread Chris Travers
On Mon, Aug 15, 2011 at 10:05 PM, Scott Marlowe wrote: > > Yep.  Also, it's REAL easy to stick a caching layer like memcached > into the middle tier app layer, but nearly impossible to do so in > pgsql.  For large systems, this would make pg as an app server a nogo. >  But for small to medium siz

Re: [GENERAL] Using Postgresql as application server

2011-08-15 Thread Scott Marlowe
On Mon, Aug 15, 2011 at 7:23 PM, Merlin Moncure wrote: > There are downsides too -- you lose access to the excellent middleware > tools out there, and you are 'stuck' on postgres and need to come up > with hard to find and expensive postgres talent.   You need to be > prepared to blaze a path, etc

Re: [GENERAL] Using Postgresql as application server

2011-08-15 Thread Darren Duncan
Chris Travers wrote: On Mon, Aug 15, 2011 at 3:47 PM, Darren Duncan wrote: I believe we basically have all the foundation already, with maybe procedures executable outside transactions being the last major part. Why is this desirable? Why is it more desirable than actually using the listen/n

Re: [GENERAL] Using Postgresql as application server

2011-08-15 Thread Chris Travers
On Mon, Aug 15, 2011 at 5:14 PM, David Johnston wrote: >> This whole line is getting somewhat off-topic; we're not talking about a >> "computationally complete" application but simply one that can handle HTTP >> requests and dispatch calls to user-defined methods.  This seems like a >> small-e

Re: [GENERAL] Using Postgresql as application server

2011-08-15 Thread Merlin Moncure
On Mon, Aug 15, 2011 at 7:06 PM, Craig Ringer wrote: > On 15/08/2011 10:36 PM, Merlin Moncure wrote: >> >> On Sat, Aug 13, 2011 at 2:30 PM, Andreas Joseph Krogh >>  wrote: >>> >>> No, PG has never, and will never, act as an application-server. >> >> Why in the world not? > > The biggest reason is

Re: [GENERAL] Using Postgresql as application server

2011-08-15 Thread David Johnston
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Darren Duncan Sent: Monday, August 15, 2011 6:48 PM To: David Johnston Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Using Postgresql as application server David

Re: [GENERAL] Using Postgresql as application server

2011-08-15 Thread Craig Ringer
On 15/08/2011 10:36 PM, Merlin Moncure wrote: On Sat, Aug 13, 2011 at 2:30 PM, Andreas Joseph Krogh wrote: No, PG has never, and will never, act as an application-server. Why in the world not? The biggest reason is safety. Beyond that, the lack of autonomous transactions, stored procedures

Re: [GENERAL] Using Postgresql as application server

2011-08-15 Thread Chris Travers
On Mon, Aug 15, 2011 at 3:47 PM, Darren Duncan wrote: > > I believe we basically have all the foundation already, with maybe > procedures executable outside transactions being the last major part. > Why is this desirable? Why is it more desirable than actually using the listen/notify infrastruc

Re: [GENERAL] Using Postgresql as application server

2011-08-15 Thread Darren Duncan
David Johnston wrote: I believe that it is ideal for Postgres to be computationally complete in that one *could* use it to implement a complete application. That isn't to say one should do this as a matter of course, good to use appropriate tools for a >>job, but that it should at least be possi

Re: [GENERAL] Using Postgresql as application server

2011-08-15 Thread David Johnston
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Merlin Moncure Sent: Monday, August 15, 2011 6:10 PM To: David Johnston Cc: Darren Duncan; pgsql-general@postgresql.org Subject: Re: [GENERAL] Using Postgresql as

Re: [GENERAL] Using Postgresql as application server

2011-08-15 Thread Merlin Moncure
On Mon, Aug 15, 2011 at 4:54 PM, David Johnston wrote: >>> >>>I believe that it is ideal for Postgres to be computationally complete in >>>that one *could* use it to implement a complete application.  That isn't to >>>say one should do this as a matter of course, good to use appropriate tools >

Re: [GENERAL] Using Postgresql as application server

2011-08-15 Thread David Johnston
>> >>I believe that it is ideal for Postgres to be computationally complete in >>that one *could* use it to implement a complete application. That isn't to >>say one should do this as a matter of course, good to use appropriate tools >>for a >>job, but that it should at least be possible if one

Re: [GENERAL] Using Postgresql as application server

2011-08-15 Thread Chris Travers
On Mon, Aug 15, 2011 at 2:05 PM, Darren Duncan wrote: > 1.  Try using multiple processes.  You can have a separate process, in a > distinct transactional context, for sending the emails, and it only does so > under certain conditions, such as if it sees that a committed change has put > the proce

Re: [GENERAL] Using Postgresql as application server

2011-08-15 Thread Darren Duncan
Chris Travers wrote: On Mon, Aug 15, 2011 at 1:44 PM, Darren Duncan wrote: I believe that it is ideal for Postgres to be computationally complete in that one *could* use it to implement a complete application. That isn't to say one should do this as a matter of course, good to use appropriate

Re: [GENERAL] Using Postgresql as application server

2011-08-15 Thread Merlin Moncure
On Mon, Aug 15, 2011 at 3:50 PM, Chris Travers wrote: > On Mon, Aug 15, 2011 at 1:44 PM, Darren Duncan > wrote: > >> I believe that it is ideal for Postgres to be computationally complete in >> that one *could* use it to implement a complete application.  That isn't to >> say one should do this

Re: [GENERAL] Using Postgresql as application server

2011-08-15 Thread Chris Travers
On Mon, Aug 15, 2011 at 1:44 PM, Darren Duncan wrote: > I believe that it is ideal for Postgres to be computationally complete in > that one *could* use it to implement a complete application.  That isn't to > say one should do this as a matter of course, good to use appropriate tools > for a job

Re: [GENERAL] Using Postgresql as application server

2011-08-15 Thread Darren Duncan
c k wrote: Dear Postgres users, from last few months I am reading and searching for can postgresql used as application server? As postgresql supports many languages like pl/perl, pl/python etc, supports dblink like functions to connect to other postgresql servers and now features are in develo

Re: [GENERAL] Using Postgresql as application server

2011-08-15 Thread Merlin Moncure
On Mon, Aug 15, 2011 at 9:50 AM, Andreas Joseph Krogh wrote: > På mandag 15. august 2011 kl 16:36:23 skrev du: >> On Sat, Aug 13, 2011 at 2:30 PM, Andreas Joseph Krogh >> wrote: >> > No, PG has never, and will never, act as an application-server. >> >> Why in the world not?  Now, it may or may no

Re: [GENERAL] Using Postgresql as application server

2011-08-15 Thread Leif Biberg Kristensen
On Monday 15. August 2011 16.36.23 Merlin Moncure wrote: > Postgres is not just a database -- it's a language hosting platform if > you want to use it as such. Now, you can continue to do things as > you've always done (database 'here', code 'here', web server 'here'), > but why discourage people

Re: [GENERAL] Using Postgresql as application server

2011-08-15 Thread Chris Travers
On Mon, Aug 15, 2011 at 7:50 AM, Andreas Joseph Krogh wrote: > Sorry if I stepped on any toes here. But seriously - by my definition of > app-server PG is not suited at all. I strongly would discourage anyone from > using any RDBMS as an app-server. *IMO* it makes development, testing, > separ

Re: [GENERAL] Using Postgresql as application server

2011-08-15 Thread Andreas Joseph Krogh
På mandag 15. august 2011 kl 16:36:23 skrev du: > On Sat, Aug 13, 2011 at 2:30 PM, Andreas Joseph Krogh > wrote: > > No, PG has never, and will never, act as an application-server. > > Why in the world not? Now, it may or may not be a good idea but there > is no technical constraint that prevent

Re: [GENERAL] Using Postgresql as application server

2011-08-15 Thread Merlin Moncure
On Sat, Aug 13, 2011 at 2:30 PM, Andreas Joseph Krogh wrote: > No, PG has never, and will never, act as an application-server. Why in the world not? Now, it may or may not be a good idea but there is no technical constraint that prevents postgresql from being used in this fashion. I think it's a

Re: [GENERAL] Using Postgresql as application server

2011-08-14 Thread Gavin Flower
On 14/08/11 05:12, David Johnston wrote: On Aug 13, 2011, at 11:57, c k wrote: Dear Postgres users, from last few months I am reading and searching for can postgresql used as application server? As postgresql supports many languages like pl/perl, pl/python etc, supports dblink like function

Re: [GENERAL] Using Postgresql as application server

2011-08-13 Thread Greg Williamson
> >Dear Postgres users, How about sending these to just one mailing list -- when you cross post everybody gets two copies of each response. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-gen

Re: [GENERAL] Using Postgresql as application server

2011-08-13 Thread Chris Travers
Hi CK: First, it depends on what you mean by an application server. There are people who in fact do very similar things with PostgreSQL, essentially having it take on roles traditionally served by middleware. On Sat, Aug 13, 2011 at 8:57 AM, c k wrote: > Dear Postgres users, > from last few mon

Re: [GENERAL] Using Postgresql as application server

2011-08-13 Thread Andreas Joseph Krogh
On 08/13/2011 05:57 PM, c k wrote: > Dear Postgres users, > from last few months I am reading and searching for can postgresql used as application server? As postgresql supports many languages like pl/perl, pl/python etc, supports dblink like functions to connect to other postgresql servers and now

Re: [GENERAL] Using Postgresql as application server

2011-08-13 Thread David Johnston
On Aug 13, 2011, at 11:57, c k wrote: > Dear Postgres users, > from last few months I am reading and searching for can postgresql used as > application server? As postgresql supports many languages like pl/perl, > pl/python etc, supports dblink like functions to connect to other postgresql >